4
# C2014, Joao Eriberto Mota Filho
5
# Based on original upstream script, available at scripts/htpdate.init
9
# Required-Start: $network $remote_fs $syslog
10
# Required-Stop: $network $remote_fs $syslog
11
# Default-Start: 2 3 4 5
13
# Short-Description: Start htpdate daemon
14
# Description: Starts and stops the htpdate daemon used to
15
# synchronize a computer time.
18
test -x /usr/bin/htpdate || exit 0
20
. /lib/lsb/init-functions || exit 0
22
if [ -f /etc/default/htpdate ]; then
23
. /etc/default/htpdate
28
if [ "$HTP_DAEMON" = "no" ]; then
29
echo "htpdate is disabled. Please, see /etc/default/htpdate."
33
HTPCOM="/usr/bin/htpdate"
34
PIDFILE="/var/run/htpdate.pid"
38
echo "Starting HTTP Time Protocol daemon: htpdate"
39
# Set the time first before daemonizing, because the time offset
40
# might be too big for smooth time adjustment
41
$HTPCOM $HTP_OPTIONS $HTP_PROXY -i $PIDFILE $HTP_SERVERS
44
echo "Stopping HTTP Time Protocol daemon: htpdate"
49
echo "$PIDFILE not found"
58
echo "Reloading htpdate"
59
start-stop-daemon --stop --signal 1 --exec $HTPCOM
62
status_of_proc -p $PIDFILE $HTPCOM htpdate
65
echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"