ページ更新: 2004-06-21 (月) (6140日前)
関連: [編集]デーモンの起動まで #ntpd を例に。 インストール済みパッケージの検索。 # rpm -qa | grep ntp ntp-4.1.2-0.rc1.2 chkfontpath-1.9.7-1 起動スクリプトの存在を確認。 # rpm -ql ntpd | grep init.d /etc/rc.d/init.d/ntpd # ls /etc/rc.d/init.d/ntp* /etc/rc.d/init.d/ntpd 既存のntpサーバ(以下では 192.168.1.2 に既存のサーバがある)に時刻を合わせてから、(-u は合ってもなくても良い。ntpd 稼働中は -u が必要) # ntpdate -u 192.168.1.2 21 Jun 22:31:00 ntpdate[27138]: adjust time server 192.168.1.2 offset 0.050095 sec せっかく時計を合わせたのだから、ついでにリアルタイムクロックの値にも反映させておく。 shutdown するときに /etc/rc.d/init.d/halt が実行され、そのとき に /sbin/hwclock --systohc が実行されるのだが、コケたときのために。 それに、稼働中のサーバの場合、shutdown するは何ヶ月〜何年も先かも知れないし。 # /sbin/hwclock --systohc # /sbin/hwclock; date Mon Jun 21 22:38:22 2004 -0.559757 seconds Mon Jun 21 22:38:22 JST 2004 chkconfig, ntsysv, serviceconf のいずれかで、起動の設定を行う。 chkconfig の場合、 現在の自動起動の設定を確認、 # chkconfig --list ntpd ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off 必要な runlevel で on にして、設定内容を確認。 (下記の場合、3 と 5) # chkconfig --level 35 ntpd on # chkconfig --list ntpd ntpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off あるいは、chkconfig に runlevel の選択を任せる # chkconfig ntpd on # chkconfig --list ntpd ntpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off 再起動する前に ntpd を起動したい場合は、次のコマンドを実行 # service ntpd start あるいは、 # /etc/rc.d/init.d/ntpd start |