First thought it was an error do to no value written in /var/lib/misc/ntp.drift . Because found this RedHat bug: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=58294 Then read on NTP site. It will take one hour approx for ntp to write to the file, then will continue at one hour intervals. I tried from example above and wrote 0.0 to the file. And with no value (default file). Both produced the same results after an hour. /var/log/ntpd.log: 26 Aug 23:30:48 ntpd[11595]: can't open /var/lib/misc/ntp.drift.TEMP: Permission denied 27 Aug 00:30:48 ntpd[11595]: can't open /var/lib/misc/ntp.drift.TEMP: Permission denied 27 Aug 01:30:48 ntpd[11595]: can't open /var/lib/misc/ntp.drift.TEMP: Permission denied This continues no matter whether value in drift file or not. There is a new group with this ebuild. Group 123 Looking at permissions on /var/lib/misc and is root root Changed permissions on folder to 'ntp' for group and made writeable for group. Then ntpd.log file started acting correctly: 27 Aug 09:24:31 ntpd[2252]: ntpd exiting on signal 15 27 Aug 09:24:32 ntpd[24261]: frequency initialized 0.000 from /var/lib/misc/ntp.drift 27 Aug 09:24:32 ntpd[24261]: running as uid(123)/gid(123) euid(123)/egid(123). 27 Aug 09:24:32 ntpd[24265]: signal_no_reset: signal 17 had flags 4000000 27 Aug 09:24:40 ntpd[24265]: signal_no_reset: signal 14 had flags 4000000 27 Aug 09:24:57 ntpd[2257]: parent died before we finished, exiting Note: will take an hour with the default drift file before get the 'frequency initialized 0.000 from /var/lib/misc/ntp.drift', until then will get 'Un-parsable frequency in /var/lib/misc/ntp.drift'. That is just until the first hour. Reproducible: Always Steps to Reproduce: 1. Emerge ntp-4.1.2 2. Copy example ntp.conf to /etc. Setup servers,... 3. rc-update add ntpd default 4. View the /var/log/ntpd.log after an hour. Will get permission errors because ntp cannot write to drift file. Actual Results: can't open /var/lib/misc/ntp.drift.TEMP: Permission denied in /var/log/ntpd.log Expected Results: After an hour ntp should have been able to write calculated drift to /var/lib/misc/ntp.drift file.
Not sure it would be a good idea to make /var/lib/misc as user:root & group:ntp So changed it back to root:root. Then changed the ntp.drift file itself to user:root & group:ntp instead of the default ntp:ntp is was set as. And added write permission for group. Seems to be working. Will have to check the logs after awhile. After checking the logs from the previous user:group change on the folder. Didn't notice the hourly update checks. So still working on this.
so you're saying that when /var/lib/misc is ntp:ntp it works fine ... and when /var/lib/misc/ntp.drift is ntp:ntp it works fine ? the ebuild does this currently: dodir /var/lib/misc touch ${D}/var/lib/misc/ntp.drift fowners ntp:ntp /var/lib/misc/ntp.drift
Sorry, uncomment the line in ntp.conf # If you want to deny all machines from accessing # your NTP server, uncomment: # restrict default ignore And ntp wouldn't work. Have to start over. Got errors with 'ntpq -p': 127.0.0.1: timed out, nothing received ***Request timed out So have to start over. But answer to your question. No, thought it was working at first. Didn't wait long enough. After letting ntp do it's thing. Got the permission errors or not hourly activity. Working on trying this right now. With default blank ntp.drift and with adding '0.000' to the file. https://www.redhat.com/archives/redhat-list/2002-November/msg03059.html Had results, but didn't know the config file was stopping me. Will post results when get them. Thanks.
PS. To not misunderstand. The config file was changed this morning. It wasn't change earlier, so wasn't causing the problems that posted for.:) FYI
quote SpanKY: so you're saying that when /var/lib/misc is ntp:ntp it works fine ... and when /var/lib/misc/ntp.drift is ntp:ntp it works fine ? SpanKY, I was thinking something else when answered your question. I think it was working that way. But didn't know if it was a good idea to change the permissions on /var/lib/misc to group ntp [123]. That folder could be used for other things so thought better to try something else. Now if you want to read the url I am working on about adding the ntp.drift.TEMP file. Then see if you like that better OR was also thinking, could make a /var/lib/misc/ntp folder. That way could try changing the permissions on it to root:ntp or ntp:ntp and see what happens. Can try all of it and see which you like best. Going away for the weekend, so after won't be able to work on it after tomorrow morning until Tuesday.
This bug report is a duplicate of #26501 and #26259. I explained everything in 26501 and don't understand how the bug should have been fixed without changing the directories permission. To write a new file you need write permission in the respective directory. The propematic file is not the drift file but the temporary file which is needed by ntpd. Just give ntpd it's own directory (say /var/lib/ntp/) for it's drift file where it has WRITE PERMISSION, i.e. owner ntp. It's really no rocked science. Adding a ntp.drift.TEMP file in /var/lib/misc is no solution because ntpd deletes this file when it's not needed anymore.
Sorry, been away for the weekend didn't get to try that till now. No, not rocket science, was working from the premise that had been worked out and was just a permission thing with the new group. TEMP wasn't being deleted either when made it in the /var/lib/misc folder, it was writing to it instead and not replacing value in ntp.drift. Also I searched before posting and those two bugs didn't pop up for some reason. Weird. I confirm that works using /var/lib/ntp with ntp:ntp as owner:group. And changing drift file location in /etc/ntp.conf. It did write to the ntp.drift file!!! Still checking on the log file. Wrote to drift file in new location, exactly 1 hour after restarting ntpd. About 20 minutes later wrote to log file 'time reset 124.063735 s' I would go with Andreas Simon on this, then problems solved.
so, if i make these changes you guys should be all set ? (i dont use ntpd so ive never had these problems ...) ntp-4.1.2.ebuild: dodir /var/lib/ntp fowners ntp.ntp /var/lib/ntp files/ntp.conf: driftfile /var/lib/ntp/ntp.drift
Yes, ntp.drift in /var/lib/ntp with those permissions is still working on my system. Don't forget to add the new location in /etc/ntp.conf :) Thanks SpanKY
ok, i've updated the ebuild and the ntp.conf file ... thanks guys ... i'll hold off version bumping once ive cleaned out the ntp bugs so these small changes wont make ppl constantly update ntp ...