2010年11月4日星期四

NTP服务自动启动的问题

NTP服务在桌面Linux上是不用去操心的。但是我用手机网络的时候,不想用NTP。可是在停止了NTP服务后,只要一联网就发现NTP又启动了。结果在/usr/share/doc/ntp/README.Debian.gz里面找到了答案:

If DHCP is used to configure the host, and the DHCP server sends
information about NTP servers, then this information will be used
automatically. This is done by making a copy of /etc/ntp.conf at
/var/lib/ntp/ntp.conf.dhcp, replacing the server entries with the
information provided by the DHCP server, and restarting the NTP
server.

In order for this to work, the "ntp-servers" option must be mentioned
in the "request" statement in /etc/dhcp3/dhclient.conf. This is not
the case in a default installation. A complete configuration might
look like this, for example:

request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope, interface-mtu,
ntp-servers;

If you don't like using the NTP servers sent by the DHCP server, this
is also the right place to turn off this behavior.

这就是说DHCP联网的话,可能会让NTP服务器重启。不需要的话,在/etc/dhcp3/dhclient.conf里面关掉即可。

PS:最近发现软件包在/usr/share/doc下对应目录里面的README.Debian.gz文件挺有用的。因为Debian经常会对原版的软件进行修改,特别是配置方式的改动。如果养成查看这个文件的习惯,可以帮助尽快地排除问题。

没有评论:

发表评论