You are not logged in.
Hello, I'm running Slitaz 5.0 (December 2016 release). My ntpd is not starting at boot. The boot message is "ntpd bad address pool.ntp.org" and it doesn't start. If I run "ntpd -p pool.ntp.org" as root it starts and in about 10 seconds it sets my system time.
I've tried installing the ntp package and then removing it after many configuration changes. Right now my files in /etc are back to default.
/etc/daemons.conf:
NTPD_OPTIONS="-p pool.ntp.org"
/etc/rcS.conf
RUN_DAEMONS="firewall httpd ntpd"
There is a link in /etc/init.d/ntpd -> daemon
The boot message says its starting /etc/init.d/network.sh
and other network messages about wpa etc and then says Connecting to MYROUTER
several lines before it attempts to start the ntpd. After boot my network is fine, and I can start the ntpd manually.
Is there a fix? Why does it fail at boot? Is there a way to start it automatically after boot?
Thanks
Offline
you can put
ntpd -p pool.ntp.org
to your /etc/init.d/locale.sh
if it does not work just put
sleep 10
before your ntpd command
Offline
Fixed.
It seems that the busybox ntpd takes a little while to engage and set the entry in /proc/???/status when contacting a pooled address like pool.ntp.org.
I found that if I added a "sleep 3" after the command to load ntpd it has time to do its thing properly and everything works.
I added one line to /etc/init.d/daemon, the relevant part shown below.
case "$1" in
start)
grep -qs $DAEMON /etc/inetd.conf && active_inetd
if active_pidfile $PIDFILE $NAME ; then
_ '%s is already running.' $NAME
exit 1
fi
action 'Starting %s: %s...' "$DESC" $NAME
$DAEMON $OPTIONS
sleep 3 #<<< THIS IS THE NEW LINE >>>#
[ -f $PIDFILE ] || pidof $NAME | awk '{print $1}' > $PIDFILE
active_pidfile $PIDFILE $NAME
status
;;
Offline
I just thought I should follow up. It appears that a 3 second delay was not sufficient. In the boot sequence the inetd get started right before the ntpd so I felt it was a good idea to give it extra time to complete before running the ntpd.
I have modified two lines in the /etc/init.d/daemon file, In the same chunk mentioned before I now have:
sleep 5
$DAEMON $OPTIONS
sleep 10
"sleep 10" replaces the "sleep 3" in the code of the previous post and the "sleep 5" is just above it.
Finally everything works as expected and the ntpd starts.
Offline
[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]