Tags: patch On Fri, 2012-06-29 at 12:16 +1000, Russell Stuart wrote: > moving /var/lib/ntp/ntp.conf.dhcp > to /var/run/ntp/ntp.conf.dhcp would ensure the problem gets fixed > eventually, as everything in /var/run gets cleaned up on reboot.
Attached is a patch that does that.
diff -Nur ntp-4.2.6.p5+dfsg.old/debian/changelog ntp-4.2.6.p5+dfsg/debian/changelog --- ntp-4.2.6.p5+dfsg.old/debian/changelog 2012-05-12 19:04:44.000000000 +1000 +++ ntp-4.2.6.p5+dfsg/debian/changelog 2012-06-29 12:27:21.318022032 +1000 @@ -1,3 +1,10 @@ +ntp (1:4.2.6.p5+dfsg-2.1) unstable; urgency=medium + + * Move /var/lib/ntp/ntp.conf.dhcp to /var/run/ntp/ntp.conf.dhcp + to it gets cleaned up on reboot. (closes: #600661) + + -- Russell Stuart <[email protected]> Fri, 29 Jun 2012 12:26:21 +1000 + ntp (1:4.2.6.p5+dfsg-2) unstable; urgency=medium * Re-enable crypto support by pointing openssl libdir to multiarch dir. diff -Nur ntp-4.2.6.p5+dfsg.old/debian/ntpdate-debian ntp-4.2.6.p5+dfsg/debian/ntpdate-debian --- ntp-4.2.6.p5+dfsg.old/debian/ntpdate-debian 2011-11-30 16:11:26.000000000 +1000 +++ ntp-4.2.6.p5+dfsg/debian/ntpdate-debian 2012-06-29 12:24:09.698744492 +1000 @@ -7,7 +7,7 @@ fi if [ "$NTPDATE_USE_NTP_CONF" = yes ]; then - for f in /var/lib/ntp/ntp.conf.dhcp /etc/ntp.conf /etc/openntpd/ntpd.conf; do + for f in /var/run/ntp/ntp.conf.dhcp /etc/ntp.conf /etc/openntpd/ntpd.conf; do if [ -r "$f" ]; then file=$f break diff -Nur ntp-4.2.6.p5+dfsg.old/debian/ntp.dhcp ntp-4.2.6.p5+dfsg/debian/ntp.dhcp --- ntp-4.2.6.p5+dfsg.old/debian/ntp.dhcp 2009-04-24 01:27:05.000000000 +1000 +++ ntp-4.2.6.p5+dfsg/debian/ntp.dhcp 2012-06-29 12:23:28.302036423 +1000 @@ -1,5 +1,5 @@ NTP_CONF=/etc/ntp.conf -NTP_DHCP_CONF=/var/lib/ntp/ntp.conf.dhcp +NTP_DHCP_CONF=/var/run/ntp/ntp.conf.dhcp ntp_server_restart() { @@ -43,6 +43,8 @@ sed -r -e '/^ *(server|peer).*$/d' $NTP_CONF ) >>$tmp + mkdir -p ${NTP_DHCP_CONF%/*} + mv $tmp $NTP_DHCP_CONF ntp_server_restart diff -Nur ntp-4.2.6.p5+dfsg.old/debian/ntp.init ntp-4.2.6.p5+dfsg/debian/ntp.init --- ntp-4.2.6.p5+dfsg.old/debian/ntp.init 2009-12-27 03:29:45.000000000 +1000 +++ ntp-4.2.6.p5+dfsg/debian/ntp.init 2012-06-29 12:25:02.131641325 +1000 @@ -22,8 +22,8 @@ . /etc/default/ntp fi -if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then - NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp" +if [ -e /var/run/ntp/ntp.conf.dhcp ]; then + NTPD_OPTS="$NTPD_OPTS -c /var/run/ntp/ntp.conf.dhcp" fi diff -Nur ntp-4.2.6.p5+dfsg.old/debian/README.Debian ntp-4.2.6.p5+dfsg/debian/README.Debian --- ntp-4.2.6.p5+dfsg.old/debian/README.Debian 2009-04-24 01:27:05.000000000 +1000 +++ ntp-4.2.6.p5+dfsg/debian/README.Debian 2012-06-29 12:22:05.092613164 +1000 @@ -28,7 +28,7 @@ If DHCP is used to configure the host, and the DHCP server sends information about NTP servers, then this information will be used automatically. This is done by making a copy of /etc/ntp.conf at -/var/lib/ntp/ntp.conf.dhcp, replacing the server entries with the +/var/run/ntp/ntp.conf.dhcp, replacing the server entries with the information provided by the DHCP server, and restarting the NTP server.

