Release 2.9.23-4
[nbd.git] / debian / nbd-server.init.d
blob3ce65b4c0b3069755f03a13347f2ab20d54afbb7
1 #!/bin/sh
2 # vim:ft=sh
4 # skeleton example file to build /etc/init.d/ scripts.
5 # This file should be used to construct scripts for /etc/init.d.
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>
13 # Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
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
26 PATH=/sbin:/bin:/usr/sbin:/usr/bin
27 DAEMON="/bin/nbd-server"
28 NAME="nbd-server"
29 DESC="Network Block Device server"
31 test -x $DAEMON || exit 0
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."
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."
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
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
59 esac
61 exit 0