~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/nbd-server

  • 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
 
# vim:ft=sh
3
 
#
4
 
# skeleton      example file to build /etc/init.d/ scripts.
5
 
#               This file should be used to construct scripts for /etc/init.d.
6
 
#
7
 
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
8
 
#               Modified for Debian GNU/Linux
9
 
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
10
 
#               Modified for the nbd-server package
11
 
#               by Wouter Verhelst <wouter@debian.org>
12
 
#
13
 
# Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
14
 
#
15
 
### BEGIN INIT INFO 
16
 
# Provides: nbd-server 
17
 
# Required-Start: $remote_fs $syslog
18
 
# Required-Stop: $remote_fs $syslog
19
 
# Should-Start: $network
20
 
# Should-Stop: $network
21
 
# Default-Start: 2 3 4 5 
22
 
# Default-Stop: 0 1 6 
23
 
# Short-Description: Network Block Device server
24
 
### END INIT INFO
25
 
 
26
 
PATH=/sbin:/bin:/usr/sbin:/usr/bin
27
 
DAEMON="/bin/nbd-server"
28
 
NAME="nbd-server"
29
 
DESC="Network Block Device server"
30
 
 
31
 
test -x $DAEMON || exit 0
32
 
 
33
 
case "$1" in
34
 
    start)
35
 
        start-stop-daemon --start --quiet --exec /bin/nbd-server --oknodo --pidfile /var/run/nbd-server.pid
36
 
        echo " $NAME."
37
 
        ;;
38
 
    stop)
39
 
        echo -n "Stopping $DESC:"
40
 
        start-stop-daemon --stop --quiet --exec /bin/nbd-server --oknodo --pidfile /var/run/nbd-server.pid --retry 1
41
 
        echo " $NAME."
42
 
        ;;
43
 
    restart|force-reload)
44
 
        echo "Restarting the $DESC is pretty harsh on clients still using it."
45
 
        echo -n "waiting 5 seconds..."
46
 
        sleep 5
47
 
        echo "You have been warned!"
48
 
        echo -n "Restarting $DESC: "
49
 
        $0 stop
50
 
        sleep 10
51
 
        $0 start
52
 
        ;;
53
 
    *)
54
 
        N=/etc/init.d/$NAME
55
 
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
56
 
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
57
 
        exit 1
58
 
        ;;
59
 
esac
60
 
 
61
 
exit 0