我正在VM中运行Ubuntu。如何禁用ntpd?
发布于 2011-03-09 15:42:48
阻止ntpd:
sudo /etc/init.d/ntp stop或
sudo service ntp stop若要防止它在启动时启动:
sudo update-rc.d -f ntp remove发布于 2017-03-30 07:20:09
对于systemd,这两个命令是:
sudo systemctl stop ntp
sudo systemctl disable ntp输出(我认为可以忽略这个警告)
ntp.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install disable ntp
insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1).
insserv: warning: current start runlevel(s) (empty) of script `ntp' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `ntp' overrides LSB defaults (1).检查:
systemctl is-enabled ntp输出
ntp.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled ntp
disabled发布于 2011-03-09 16:57:23
如果已安装ntpd,请卸载它。您仍将安装ntpdate。(很难移除。)通过向exit 0添加/etc/default/ntpdate来阻止其执行。
更新:这是一个旧的答案。大多数系统现在都使用systemctl来运行命令。若要禁用ntp和ntpdate,请发出以下命令:
systemctl disable ntp.service
systemctl disable ntpdate.service 您可以使用以下命令检查ntp相关单元的状态:
systemctl list-unit-files | grep ntp https://askubuntu.com/questions/29663
复制相似问题