ntpの稼働させ方
時刻合わせで有名なntpの稼働させ方です。
なお、Linux はVine Linux 6.0です。
0、suになる
su
パスワード入力
1、ntpサーバーの設定
/etc/ntp.conf
で
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10
の下にntpサーバーを書く。
ntpサーバーはお好きなものを選べば良いですが、
私は
server ntp.nict.jp
server ntp.tohoku.ac.jp
としています。
2、ntpのデーモンntpdを起動
/etc/rc.d/init.d/ntpd start
3、ntpサーバーと時刻同期しているかチェック
/usr/sbin/ntpq -p
ntpサーバの名前の前に*か+が出ていればok
4、ntpdを自動的に動かすように設定
/sbin/chkconfig on
5、ちゃんと設定できたかチェック
/sbin/chkconfig --list ntpd
ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
となっていればok。