[LinuxPPS] PPS stops working after a few seconds
Hal V. Engel
hvengel at astound.net
Thu Mar 26 18:50:32 CET 2009
On Thursday 26 March 2009 10:33:22 am Udo van den Heuvel wrote:
> clemens at dwf.com wrote:
> > Join the club.
>
> Which one? ;-)
>
> > This is another instance of the problem that Hal V. Engel and I discussed
> > about a month ago. I have seen it (mainly) on startup, and Hal's
> > suggestion to start ntpd, stop it, then restart it, works. It would be
> > nice to know what the problem is with linuxPPS that this works around,
> > but it does consistantly start for me now.
> >
> > You dont say if this is just after a reboot (and you never had ntpd
> > running) or if it just 'happened', but from the counts it looks like the
> > latter.
>
> It happened.
> ntpd was running for a few weeks on my trusty VIA EK8000.
>
> > I have seen this same behaviour of the counts increasing by one each time
> > I do something, and assume that it should be a clue as to what is wrong
> > with the code.
> >
> > So, no solution, but welcome to the club.
>
> No solution?
>
> > [[ As I mentioned above, Hal's suggestion of starting ntpd (from init.d)
> > waiting 20sec, killing ntpd, then restarting ntpd works for me. ]]
>
> Ah, a workaround...!
> Will try!
My current solution involves a wrapper init script that starts ppsldisc and
then ntpd (by calling the normal ntp init script - /etc/init.d/ntpd start) and
then killing both and then restarting these a second time. I have my custom
wrapper script (/etc/init.d/ntp-pps) setup as a startup script for the default
run level. I have attached a copy of my wrapper script as an example since
it will likely need to be modified for your distro and how things are setup on
your machine.
Using this wrapper script makes the ntp startup 100% reliable after restarting
my system. But if I only start ppsldisc and ntpd once after a system restart
it always fails. This workaround is a hack and it would be nice if the
underlaying issue was fixed.
Hal
-------------- next part --------------
#!/sbin/runscript
depend() {
need net
use dns logger
after ntp-client
}
start() {
ebegin "Starting custom ntpd"
/bin/ppsldisc /dev/ttyS1 &
sleep 5 # give ppsldisc and udev time to get settled
/etc/init.d/ntpd start
sleep 20 # give ntpd time to start before killing ppsldisc
killall ppsldisc
/etc/init.d/ntpd stop
/bin/ppsldisc /dev/ttyS1 &
sleep 5
/etc/init.d/ntpd start
sleep 50 # give ntpd time to start before killing ppsldisc
killall ppsldisc
}
stop() {
ebegin "Stopping custom ntpd"
/etc/init.d/ntpd stop
}
More information about the LinuxPPS
mailing list