~cbehrens/nova/lp844160-build-works-with-zones

« back to all changes in this revision

Viewing changes to debian/nova-volume.init

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
### BEGIN INIT INFO
 
3
# Provides:          nova-volume
 
4
# Required-Start:    $remote_fs $syslog
 
5
# Required-Stop:     $remote_fs $syslog
 
6
# Default-Start:     2 3 4 5
 
7
# Default-Stop:      0 1 6
 
8
# Short-Description: nova-volume
 
9
# Description:       nova-volume
 
10
### END INIT INFO
 
11
 
 
12
 
 
13
set -e
 
14
 
 
15
DAEMON=/usr/bin/nova-volume
 
16
DAEMON_ARGS="--flagfile=/etc/nova.conf"
 
17
PIDFILE=/var/run/nova-volume.pid
 
18
 
 
19
ENABLED=false
 
20
 
 
21
if test -f /etc/default/nova-volume; then
 
22
  . /etc/default/nova-volume
 
23
fi
 
24
 
 
25
. /lib/lsb/init-functions
 
26
 
 
27
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
 
28
 
 
29
case "$1" in
 
30
  start)
 
31
    test "$ENABLED" = "true" || exit 0
 
32
    log_daemon_msg "Starting nova volume" "nova-volume"
 
33
    cd /var/run
 
34
    if $DAEMON $DAEMON_ARGS start; then
 
35
      log_end_msg 0
 
36
    else
 
37
      log_end_msg 1
 
38
    fi
 
39
    ;;
 
40
  stop)
 
41
    test "$ENABLED" = "true" || exit 0
 
42
    log_daemon_msg "Stopping nova volume" "nova-volume"
 
43
    cd /var/run
 
44
    if $DAEMON $DAEMON_ARGS stop; then
 
45
      log_end_msg 0
 
46
    else
 
47
      log_end_msg 1
 
48
    fi
 
49
    ;;
 
50
  restart|force-reload)
 
51
    test "$ENABLED" = "true" || exit 1
 
52
    cd /var/run
 
53
    if $DAEMON $DAEMON_ARGS restart; then
 
54
      log_end_msg 0
 
55
    else
 
56
      log_end_msg 1
 
57
    fi
 
58
    ;;
 
59
  status)
 
60
    test "$ENABLED" = "true" || exit 0
 
61
    status_of_proc -p $PIDFILE $DAEMON nova-volume && exit 0 || exit $?
 
62
    ;;
 
63
  *)
 
64
    log_action_msg "Usage: /etc/init.d/nova-volume {start|stop|restart|force-reload|status}"
 
65
    exit 1
 
66
    ;;
 
67
esac
 
68
 
 
69
exit 0