ntpd雜記

[root@PC1 etc]# cd init.d
[root@PC1 init.d]# ./ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@PC1 init.d]# ntpdate  199.31.176.198
15 Jul 11:27:46 ntpdate[31931]: step time server 199.31.176.198 offset -21.680058 sec
[root@PC1 init.d]# 
[root@PC1 init.d]# 
[root@PC1 init.d]# ./ntpd start
Starting ntpd:                                             [  OK  ]
[root@PC1 init.d]# 
[root@PC1 init.d]# 
[root@PC1 init.d]# ntpdate  199.31.176.198
15 Jul 11:27:57 ntpdate[31939]: the NTP socket is in use, exiting



[root@PC2 ~]#   lsof -i:123
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ntpd    1955  ntp   16u  IPv4  11084      0t0  UDP *:ntp 
ntpd    1955  ntp   17u  IPv6  11085      0t0  UDP *:ntp 
ntpd    1955  ntp   18u  IPv6  11089      0t0  UDP localhost:ntp 
ntpd    1955  ntp   19u  IPv6  11090      0t0  UDP [fe80::250:56ff:feb4:389b]:ntp 
ntpd    1955  ntp   20u  IPv4  11091      0t0  UDP localhost:ntp 
ntpd    1955  ntp   21u  IPv4  11092      0t0  UDP PC2:ntp 
[root@PC2 ~]# ps -ef|grep 1955
ntp       1955     1  0  2014 ?        00:01:23 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root     27045 26469  0 11:25 pts/0    00:00:00 grep 1955
[root@PC2 ~]# kill -9 1955
[root@PC2 ~]# 

[root@PC2 ~]# which ntpd
/usr/sbin/ntpd


[root@PC2 ~]# ps -ef|grep xntpd
root     26804 26469  0 11:20 pts/0    00:00:00 grep xntpd
[root@PC2 ~]# 

[root@STIRSAPP04 ~]# /etc/init.d/ntpd stop ; sleep 5 && ntpdate  199.31.176.198 && /etc/init.d/ntpd start
Shutting down ntpd:                                        [  OK  ]
15 Jul 15:18:13 ntpdate[10407]: adjust time server 199.31.176.198 offset -0.003343 sec
Starting ntpd:                                             [  OK  ]
[root@STIRSAPP04 ~]# 


----------------Aix


root@IRSKF02:/etc>stopsrc -s xntpd
0513-004 The Subsystem or Group, xntpd, is currently inoperative.
root@IRSKF02:/etc>
root@IRSKF02:/etc>
root@IRSKF02:/etc>
root@IRSKF02:/etc>
root@IRSKF02:/etc>ntpdate  199.31.176.198
15 Jul 11:32:38 ntpdate[18481188]: adjust time server 199.31.176.198 offset 0.000749
root@IRSKF02:/etc>

root@IRSKF02:/etc>startsrc -s xntpd
0513-059 The xntpd Subsystem has been started. Subsystem PID is 6881328.
root@IRSKF02:/etc>ps -ef|grep 6881328
    root  6881328  3276918   0 11:33:27      -  0:00 /usr/sbin/xntpd
root@IRSKF02:/etc>
root@IRSKF02:/etc>
root@IRSKF02:/etc>ntpdate  199.31.176.198
15 Jul 11:33:53 ntpdate[12976302]: the NTP socket is in use, exiting



root@kfirs03:/.root>stopsrc -s xntpd ; sleep 5 && ntpdate  199.31.176.198  &&  startsrc -s xntpd
0513-044 The /usr/sbin/xntpd Subsystem was requested to stop.
15 Jul 15:17:59 ntpdate[10682426]: adjust time server 199.31.176.198 offset -0.001081
0513-059 The xntpd Subsystem has been started. Subsystem PID is 10092722.
root@kfirs03:/.root>
相關文章
相關標籤/搜索