ClearOS Bug Tracker


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000371ClearOSapp-ntp - NTP Serverpublic2011-10-24 00:292013-08-14 19:12
Reporterdevferret 
Assigned Touser2 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version6.5.0 Beta 1Fixed in Version6.5.0 Beta 1 
Summary0000371: ntpd will stop working when network interfaces change
DescriptionMy external interface uses pppoe; if that ever goes down and up again (which it does regularly, grrrr. ADSL grrr.) ntp stops being able to communicate with any external servers.

The problem is fully described here:
http://lists.ntp.org/pipermail/questions/2005-August/006332.html [^]

ntp.org admits the issue here: http://support.ntp.org/bin/view/Support/ConfiguringNTP#Section_6.13. [^]
> Currently, ntpd does not rescan the network interfaces after it has started.
> If you are have a dynamic IP (use DHCP), this means ntpd will no longer be
> able to communicate with "outside" sources after your IP changes.

My hack for fixing it is below. It's not ideal... in particular the init scripts start ntpd with -g which will cause a step-jump in the time; in this case ntpd should be restarted with -x so the time is slewed. Also not sure if /etc/ppp/ip-up.local is the best place.

/etc/ppp/ip-up.local:

/usr/share/system/scripts/firewall-up $1
# gid -- ntpd can't handle changing interface, so restart
if [[ $1 == ppp0 && -x /etc/init.d/ntpd ]] ; then
  logger "ppp0 up -- restarting ntpd"
  /etc/init.d/ntpd condrestart
fi

Finally, I think this means that modifying any network interfaces via the webconfig will also cause this to happen (for the modified interface). Not sure if ntpd already gets restarted in that case.
Additional InformationSample logs... ADSL goes down, ntpd starts erroring:

Oct 11 11:33:22 office pppd[21695]: Connection terminated.
Oct 11 11:33:22 office pppd[21695]: Modem hangup
Oct 11 11:33:27 office pppd[21695]: Exit.
Oct 11 11:33:27 office pppoe[21696]: read (asyncReadFromPPP): Session 4185: Input/output error
Oct 11 11:33:27 office pppoe[21696]: Sent PADT
Oct 11 11:33:27 office adsl-connect: ADSL connection lost; attempting re-connection.
Oct 11 11:33:29 office adsl-stop: Killing pppd
Oct 11 11:33:29 office adsl-stop: Killing adsl-connect
Oct 11 11:33:33 office ntpd[21887]: sendto(64.34.185.196) (fd=24): Invalid argument

That last message will repeat each time ntpd tries to talk to any peer.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000969)
user2
2013-08-02 11:19

Source Code Changelog
---------------------------------------------------
- Added network event to ntp to handle restarts on dynamic IPs [tracker 0000371]

File Changes
---------------------------------------------------
Details: http://code.clearfoundation.com/svn/revision.php?repname=ClearOS&rev=6298 [^]
U webconfig/apps/ntp/trunk/deploy/info.php
U webconfig/apps/ntp/trunk/packaging/app-ntp.spec
A webconfig/apps/ntp/trunk/packaging/network-connected-event

- Issue History
Date Modified Username Field Change
2011-10-24 00:29 devferret New Issue
2011-10-24 12:31 user2 Status new => confirmed
2013-02-02 11:02 user2 Target Version => 6.4.0 Beta 2
2013-02-21 20:00 user2 Target Version 6.4.0 Beta 2 => 6.4.0
2013-03-14 11:56 user2 Target Version 6.4.0 => 6.4.0 Updates
2013-07-29 13:57 user2 Target Version 6.4.0 Updates => 6.5.0 Beta 1
2013-08-02 11:19 user2 Checkin
2013-08-02 11:19 user2 Note Added: 0000969
2013-08-02 11:19 user2 Status confirmed => resolved
2013-08-02 11:19 user2 Fixed in Version => 6.5.0 Beta 1
2013-08-02 11:19 user2 Resolution open => fixed
2013-08-02 11:19 user2 Assigned To => user2
2013-08-14 19:12 user2 Status resolved => closed