LoginSignup
3
4

More than 5 years have passed since last update.

linuxの時間がおかしいから直した

Last updated at Posted at 2012-11-19

linux(debian lenny)の時間がなんかおかしい。けどntpdは動いてる。

[$] <> ps aux | grep ntpd
ntp      22190  0.0  0.0   4156  1268 ?        Ss   15:02   0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -u 108:109 -g
2001     22479  0.0  0.0   4996   788 pts/7    S+   15:05   0:00 grep ntpd

まずntpdをストップ

[$] <git:(master)> sudo  /etc/init.d/ntp stop                                                                                                                                                                                                                                   
Stopping NTP server: ntpd.

時間を合わせる

[$] <git:(master)> sudo /usr/sbin/ntpdate ntp.nict.jp
19 Nov 15:02:40 ntpdate[22143]: step time server 133.243.238.244 offset -32205.637181 sec

この時点で時間は直った。
ntpdを再起動する

[$] <git:(master)> sudo  /etc/init.d/ntp start
Starting NTP server: ntpd.

おk。

ぐぐったところ/etc/init.d/ntpdを動かすドキュメントが出てきたけど、ディストリビューションによって違うんだと思う。

参考
ntpd の起動と動作確認 http://www.turbolinux.co.jp/products/server/11s/user_guide/x6278.html
NTP サーバ一覧 http://www.venus.dti.ne.jp/~yoshi-o/NTP/NTP-Table.html

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4