~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/radioclk

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
#
3
 
### BEGIN INIT INFO
4
 
# Provides:          radioclk
5
 
# Required-Start:    $local_fs $remote_fs $network
6
 
# Required-Stop:     $local_fs $remote_fs
7
 
# Default-Start:     2 3 4 5
8
 
# Default-Stop:      0 1 6
9
 
# Short-Description: Start simple radio NTP reference clock daemon
10
 
# Description: Start simple radio NTP reference clock daemon
11
 
### END INIT INFO
12
 
 
13
 
 
14
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin
15
 
DAEMON=/usr/sbin/radioclkd
16
 
NAME=radioclkd
17
 
DESC="Radio Clock daemon"
18
 
DEFAULTS=/etc/default/radioclk
19
 
 
20
 
test -f $DAEMON || exit 0
21
 
 
22
 
set -e
23
 
 
24
 
if [ -e "$DEFAULTS" ] ; then
25
 
        . "$DEFAULTS"
26
 
fi
27
 
 
28
 
if [ "$PORT" = "" ] ; then
29
 
        printf "You need to edit $DEFAULTS before using $NAME.\n"
30
 
        exit 0
31
 
fi
32
 
 
33
 
case "$1" in
34
 
  start)
35
 
        echo -n "Starting $DESC: "
36
 
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
37
 
                --exec $DAEMON -- $PORT
38
 
        echo "$NAME."
39
 
        ;;
40
 
  stop)
41
 
        echo -n "Stopping $DESC: "
42
 
        start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
43
 
                --exec $DAEMON
44
 
        echo "$NAME."
45
 
        ;;
46
 
  #reload)
47
 
        #
48
 
        #       If the daemon can reload its config files on the fly
49
 
        #       for example by sending it SIGHUP, do it here.
50
 
        #
51
 
        #       If the daemon responds to changes in its config file
52
 
        #       directly anyway, make this a do-nothing entry.
53
 
        #
54
 
        # echo "Reloading $DESC configuration files."
55
 
        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
56
 
        #       /var/run/$NAME.pid --exec $DAEMON
57
 
  #;;
58
 
  restart|force-reload)
59
 
        #
60
 
        #       If the "reload" option is implemented, move the "force-reload"
61
 
        #       option to the "reload" entry above. If not, "force-reload" is
62
 
        #       just the same as "restart".
63
 
        #
64
 
        echo -n "Restarting $DESC: "
65
 
        start-stop-daemon --stop --quiet --pidfile \
66
 
                /var/run/$NAME.pid --exec $DAEMON
67
 
        sleep 1
68
 
        start-stop-daemon --start --quiet --pidfile \
69
 
                /var/run/$NAME.pid --exec $DAEMON -- $PORT
70
 
        echo "$NAME."
71
 
        ;;
72
 
  *)
73
 
        N=/etc/init.d/$NAME
74
 
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
75
 
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
76
 
        exit 1
77
 
        ;;
78
 
esac
79
 
 
80
 
exit 0