ntpdの設定 [Vine 5.2]
時刻合わせプログラム ntpdを設定したという話。
ntpdは、Vine Linux をインストールした時に設定したつもりだったのですが、忘れていたようです。せっかく自分でメモを書いていたのに。ちなみに、その以前書いたメモというのは、
[PC] ThinkPad X200s のページ : Vine Linux 5.1 のインストールが済んだら
です。
さてntpdの設定と起動です。設定は/etc/ntpd.conf ファイルで行います。なぜこのファイルかというと、ntpdの起動ファイル /etc/rc.d/init.d/ntpd にそう書いてあるからです。
さてさて。
mfeedの時刻情報提供サービスを使うことにしました:
/etc/ntp.conf 抜粋:
server ntp.jst.mfeed.ad.jp
記録(ログ)を、/var/log/ntp.log というファイルに書くことにしました:
/etc/ntp.conf 抜粋:
logfile /var/log/ntp.log
手動で ntpdを起動します:
/etc/rc.d/init.d/ntpd start
ntpdを起動中: [ OK ]
ntpdが自動的に起動するように設定します:
# chkconfig --list ntpd
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost etc]# chkconfig --level 345 ntpd on
[root@localhost etc]# chkconfig --list ntpd
ntpd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ちゃんと動いているかな?
tail /var/log/messagesMar 30 xx:xx:xx localhost ntpd[18957]: ntpd 4.2.4p8@1.1612 Sat Dec 12 07:35:42 UTC 2009 (1)
Mar 30 xx:xx:xx localhost ntpd[18958]: precision = 1.000 usec
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #1 wildcard, ::#123 Disabled
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #2 eth0, fe80::21f:16ff:fe1c:a1f2#123 Enabled
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #3 lo, ::1#123 Enabled
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
Mar 30 xx:xx:xx localhost ntpd[18958]: Listening on interface #5 eth0, 192.168.1.11#123 Enabled
Mar 30 xx:xx:xx localhost ntpd[18958]: kernel time sync status 0040
無事に時刻合わせが行われているようです。(xx:xx:xxには実際の時刻が入ります。)# cat /var/log/ntp.log
30 Mar xx:xx:xx ntpd[18958]: synchronized to 210.173.160.87, stratum 2
30 Mar xx:xx:xx ntpd[18958]: time reset -5.766087 s
30 Mar xx:xx:xx ntpd[18958]: synchronized to 210.173.160.87, stratum 2
2011-04-01 00:00
nice!(0)
コメント(0)
トラックバック(0)
コメント 0