fb6c286697
Add the _ntp user that the daemon requires to work in any way. Add a SysV-style initscript as well, but not with '-s' (set time immediately after startup) because it can make the boot process stall for a few seconds if there's no proper network connectivity/dns setup. Make ntp and openntpd mutually exclusive since they overstep each other. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
26 lines
448 B
Bash
Executable File
26 lines
448 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ -x /usr/sbin/ntpd ] || exit 0
|
|
[ -f /etc/ntpd.conf ] || exit 0
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Starting openntpd: "
|
|
start-stop-daemon -S -x /usr/sbin/ntpd
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
|
;;
|
|
stop)
|
|
echo -n "Stopping openntpd: "
|
|
start-stop-daemon -K -x /usr/sbin/ntpd
|
|
[ $? == 0 ] && echo "OK" || echo "FAIL"
|
|
;;
|
|
restart)
|
|
"$0" stop
|
|
sleep 1
|
|
"$0" start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
;;
|
|
esac
|