centos自動校時問題~

yum -y install ntp
--------------------------------
vi /etc/ntp.conf
加入
server tock.stdtime.gov.tw
server time.stdtime.gov.tw
server watch.stdtime.gov.tw
預設加#刪除
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
--------------------------------
systemctl start ntpd
systemctl enable ntpd
hwclock –w
ntpstat測試沒問題~
centos自動校時問題~


但重開機後,用ntpstat測試~
centos自動校時問題~
ntpd服務就是沒起來
得再下一次command
systemctl start ntpd
才可成功~

但之前明明已經systemctl enable ntpd,設成開機啟動了
只要重開機,ntpd服務就是起不來,
這有解嗎?



2018-03-26 13:32 發佈
[root@localhost ~]# ls -l /usr/lib/systemd/system |grep ntpd.service
-rw-r--r--. 1 root root 249 Apr 12 2017 ntpd.service

[root@localhost ~]# ll /etc/systemd/system/multi-user.target.wants/ntpd.service
lrwxrwxrwx 1 root root 36 Mar 27 17:57 /etc/systemd/system/multi-user.target.wants/ntpd.service -> /usr/lib/systemd/system/ntpd.service

確定一下看 ntpd.service 有沒有呦 !

正常 .....

只是

# systemctl enable ntpd
Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.


不然
systemctl start ntpd

放到

/etc/rc.local 內 ... 一定會啟動 ....
自己回應自己~
---------------------------------------------------------
終於解決校時問題了
原來centos7預設就有裝chorny校時套件
而自己又去裝ntpd,所以開機時兩者相衝,導致ntpd服務起不來
因此,改用預設chorny套件,移除ntpd,就可以囉~

同時也謝謝echochio大~
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?