Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32490 - dhcpcd sets incorrect location for ntp.drift file
Summary: dhcpcd sets incorrect location for ntp.drift file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-01 13:29 UTC by stuart2048
Modified: 2003-11-03 17:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stuart2048 2003-11-01 13:29:48 UTC
When dhcpcd-1.3.22_p4-r1 received NTP information from its DHCP server,
it writes a new /etc/ntp.conf file.  However this ntp.conf file sets
the location of ntp.drift incorrectly.

The ntp-4.1.2.ebuild specifies that ntp.drift lives at /var/lib/ntp/ntp.drift.
However, dhcpcd sets the following

    driftfile /etc/ntp.drift

The result is that ntpd fails to write its driftfile, because the ntp daemon
does not have write permission to /etc.

The solution is to change dhcpcd's driftfile setting to /var/lib/ntp/ntp.drift,
in coordination with the ntp-4.1.2.ebuild.

The workaround to this problem is to edit "/etc/conf.d/net" and pass
the -N option to dhcdcd:

    iface_eth0="dhcp"
    dhcpcd_eth0="-N"

However, this means that my ntp.conf file must be maintained by hand
from now on.


Reproducible: Always
Steps to Reproduce:
1.  Fire up dhcpcd (*without* the -N parameter) and serve it some NTP options.
2.  Check the /etc/ntp.conf file to see the newly written settings.  You should
see "driftfile /etc/ntp.drift" somewhere in the config.
3.  Fire up "/etc/init.d/ntpd restart" and "tail -f /var/log/ntp.log".


Actual Results:  
If your ntp environment it set up correctly, you should eventually see
the following in your /var/log/ntp.log:

28 Oct 13:43:13 ntpd[24268]: can't open /etc/ntp.drift.TEMP: Permission denied
28 Oct 14:43:13 ntpd[24268]: can't open /etc/ntp.drift.TEMP: Permission denied
28 Oct 15:43:13 ntpd[24268]: can't open /etc/ntp.drift.TEMP: Permission denied

Notice that this error is repeated once per hour.
Comment 1 SpanKY gentoo-dev 2003-11-03 17:03:13 UTC
upgrade to dhcpcd-1.3.22_p4-r2