File: init.d

package info (click to toggle)
chrony 1.21z-5
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 2,080 kB
  • ctags: 2,375
  • sloc: ansic: 14,831; yacc: 858; sh: 588; perl: 426; makefile: 148
file content (59 lines) | stat: -rw-r--r-- 1,854 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/sh
#
# This file was automatically customized by debmake on Fri,  6 Nov 1998 23:00:08 -0600
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>
# Modified for chrony by John Hasler <jhasler@debian.org> 1998-2006

### BEGIN INIT INFO
# Provides:          time-daemon
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Decription:  Controls chronyd NTP time daemon
# Description:       Chronyd is the NTP time daemon in the Chrony package
#              
### END INIT INFO


PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/chronyd
FLAGS="defaults"
NAME="chronyd"
DESC="time daemon"

test -f $DAEMON || exit 0

case "$1" in
  start)
    start-stop-daemon --start --verbose --exec $DAEMON
    sleep 1
    route 2>/dev/null | grep -q default && /etc/ppp/ip-up.d/chrony > /dev/null || true
    ;;
  stop)
    start-stop-daemon --stop --verbose --oknodo --exec $DAEMON
    ;;
  restart|force-reload)
        #
        #       If the "reload" option is implemented, move the "force-reload"
        #       option to the "reload" entry above. If not, "force-reload" is
        #       just the same as "restart".
        #                                                                                   
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --exec $DAEMON -- -r
        sleep 1
        route 2>/dev/null | grep -q default && /etc/ppp/ip-up.d/chrony > /dev/null || true
        echo "$NAME."
        ;;
  *)
    echo "Usage: /etc/init.d/chrony {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0