Running ntpclient in the background from init.d scripts doesn't require nohup and only one '&' is needed. I changed those.
How to Fix the Clock using Only ntpclient (correctly)
The documentation for ntpclient says:
On to ntpclient -l. This is actually easy, if you performed and understood the previous steps. Run
which to me implies that you must deliberately run ntpclient in the background when using -l.
This is what I use then, following the advice in http://doolittle.icarus.com/ntpclient/HOWTO(approve sites)
ipkg install ntpclient
Create the file
#!/bin/sh if [ -n "`pidof ntpclient`" ]; then /bin/killall ntpclient 2>/dev/null fi /opt/bin/ntpclient -f 0 -s -l -i 600 -g 10000 -h pool.ntp.org >> /var/log/ntp.log &
This keeps accurate time on my Unslung as compared to an atomic (radio-controlled) clock. It is simpler than explicit use of adjtimex but still corrects the drift using that feature of ntpclient.
Alternate method based on ntpclient
Unfortunately, the above method does not work correctly for me. Somehow, ntpclient gives up after some time, with the
What I do instead of running ntpclient as background job, is running a small script basically doing an endless loop containing
I start this script from a wrapper script in
Is this an appropriate solution, or are there better ideas?