开启NTPD服务功能为什么记录ntp.drift老是失败呢,求解答

中文QNX 讨论: 欢迎大家灌水,讨论有关QNX 问题。
回复
vansharp
Senior Member
帖子: 49
注册时间: 周五 1月 16, 2009 10:40 am

开启NTPD服务功能为什么记录ntp.drift老是失败呢,求解答

帖子 vansharp » 周五 4月 22, 2011 9:23 am

/etc/ntp/ntp.conf是这么配置的
/******************************************************/
# Example for the Internet server
server 192.168.1.1 #GPS

# Example for a stand alone server
server 127.127.1.0
fudge 127.127.1.0 stratum 10

restrict 127.0.0.1 nomodify

driftfile /etc/ntp/ntp.drift
logfile /etc/ntp/ntp.log
/******************************************************/
root用户下正常启动 ntpd -dg
ntp.log能正常记录ntpd的事件:
21 Apr 08:30:45 ntpd[1085456]: synchronized to 192.168.1.1, stratum 1
.TEMP:Invalid argument85456]: can't open /etc/ntp/ntp.drift
.TEMP:Invalid argument85456]: can't open /etc/ntp/ntp.drift
.TEMP:Invalid argument85456]: can't open /etc/ntp/ntp.drift
.TEMP:Invalid argument85456]: can't open /etc/ntp/ntp.drift
/******************************************************/
补充下
/etc/ntp下的ntp.conf ntp.drift ntp.log的权限都是777呀,求各位解答。

vansharp
Senior Member
帖子: 49
注册时间: 周五 1月 16, 2009 10:40 am

Re: 开启NTPD服务功能为什么记录ntp.drift老是失败呢,求解答

帖子 vansharp » 周二 4月 26, 2011 8:44 am

By default, the /etc/init.d/ntpd startup script starts ntp with the -U ntp command-line option, which causes ntpd to run as user "ntp". This can cause /var/log/ntp.log to get messages like "can't open /etc/ntp.drift.TEMP: Permission denied". To prevent this, do:

touch /etc/ntp.drift /etc/ntp.drift.TEMP
chown ntp /etc/ntp.drift /etc/ntp.drift.TEMP

请问QNX下也是这么处理的吗?参考这个说明做了好像还是提示上面相同的问题呀 :? [/url][/i][/quote]

回复