Added clvm-config package and made sipb-xen-host-master depend on it
[invirt/packages/sipb-xen-clvm-config.git] / debian / init
1 #! /bin/sh
2 ### BEGIN INIT INFO
3 # Provides:          sipb-xen-clvm-config
4 # Required-Start:    $ccs $cman
5 # Required-Stop:
6 # Should-Start:      $network
7 # Default-Start:     S
8 # Default-Stop:
9 # Short-Description: Start clvm daemon
10 # Description:       Network file systems are mounted by
11 #                    /etc/network/if-up.d/mountnfs in the background
12 #                    when interfaces are brought up; this script waits
13 #                    for them to be mounted before carrying on.
14 ### END INIT INFO
15
16 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
17 DAEMON=/sbin/clvmd
18 NAME=sipb-xen-clvm-config
19 PIDFILE=/var/run/cluster/clvmd.pid
20 DESC="Cluster LVM"
21
22 test -x $DAEMON || exit 0
23
24 CLVMD_OPTIONS=""
25
26 if [ -f /etc/default/sipb-xen-clvm-config ] ; then
27         . /etc/default/sipb-xen-clvm-config
28 fi
29
30 set -e
31
32 case "$1" in
33   start)
34         echo -n "Starting $DESC: "
35         start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $CLVMD_OPTIONS
36         echo "$NAME."
37         ;;
38   stop)
39         echo -n "Stopping $DESC: "
40         start-stop-daemon --stop --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON
41         echo "$NAME."
42         ;;
43   restart|force-reload)
44         echo -n "Restarting $DESC: "
45         $0 stop
46         sleep 1
47         $0 start
48         echo "$NAME."
49         ;;
50   *)
51         N=/etc/init.d/$NAME
52         echo "Usage: $N {start|stop|restart|force-reload}" >&2
53         exit 1
54         ;;
55 esac
56
57 exit 0