[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: What's the easiest way to make Busybox keep correct time?
From:       K.S. <skyscanner () gmx ! ca>
Date:       2014-08-31 22:45:09
Message-ID: loom.20140901T003627-154 () post ! gmane ! org
[Download RAW message or body]

Isaac Dunham <ibid.ag <at> gmail.com> writes:

> Yes, it's because of the -q option; remove it if you want ntpd to run
> as a daemon.

Thank you.  I did that and now it shows up in the process list, so I hope
it's actually working!

> Put a line starting ntpd in the appropriate init script or
> add an init script starting it.
> I can't tell you what this looks like in more detail, because I have no
> idea what init system you use.

It looks to me like all the init scripts on this system are in /etc/init.d
and that I should just be able to create a new script in that directory
called S95ntpd containing the following:

#!/bin/sh
#
# ntpd        Starts ntpd
#

start() {
	echo -n "Starting ntpd: "
	/usr/sbin/ntpd -p north-america.pool.ntp.org
	echo "OK"
}
stop() {
	echo -n "Stopping ntpd: "
	killall ntpd
	echo "OK"
}
restart() {
	stop
	start
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	restart
	;;
  *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit $?

I want to wait a few hours and make sure that ntpd is really working before
I install that script, but does the script itself look okay?  I basically
took another script that was already there and edited it to start ntpd.

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic