~mordred/nova/add-feedparser

« back to all changes in this revision

Viewing changes to debian/nova-instancemonitor.init

  • Committer: Soren Hansen
  • Date: 2011-08-02 19:18:16 UTC
  • Revision ID: soren@linux2go.dk-20110802191816-8rooq7n6hmxu3j0q
* Remove nova-instancemonitor package (dropped upstream).
* Remove twisted dependency (dropped upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
### BEGIN INIT INFO
3
 
# Provides:          nova-instancemonitor
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-instancemonitor
9
 
# Description:       Monitor your virtual machine resource usages
10
 
### END INIT INFO
11
 
 
12
 
set -e
13
 
 
14
 
DAEMON=/usr/bin/nova-instancemonitor
15
 
DAEMON_ARGS="--flagfile=/etc/nova/nova.conf"
16
 
PIDFILE=/var/run/nova/nova-instancemonitor.pid
17
 
 
18
 
ENABLED=true
19
 
 
20
 
if test -f /etc/default/nova-instancemonitor; then
21
 
  . /etc/default/nova-instancemonitor
22
 
fi
23
 
 
24
 
mkdir -p /var/run/nova
25
 
chown nova:root /var/run/nova
26
 
 
27
 
mkdir -p /var/lock/nova
28
 
chown nova:root /var/lock/nova
29
 
 
30
 
uid="$(getent passwd nova | cut -f3 -d:)"
31
 
gid="$(getent passwd nova | cut -f4 -d:)"
32
 
DAEMON_ARGS="${DAEMON_ARGS} --uid $uid --gid $gid --pidfile $PIDFILE"
33
 
 
34
 
. /lib/lsb/init-functions
35
 
 
36
 
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
37
 
 
38
 
if ! [ -x ${DAEMON} ] ; then
39
 
        exit 0
40
 
fi
41
 
 
42
 
case "$1" in
43
 
start)
44
 
        test "$ENABLED" = "true" || exit 0
45
 
        log_daemon_msg "Starting nova compute" "nova-instancemonitor"
46
 
        start-stop-daemon --start --chdir /var/run --exec ${DAEMON} -- ${DAEMON_ARGS}
47
 
        log_end_msg $?
48
 
;;
49
 
stop)
50
 
        test "$ENABLED" = "true" || exit 0
51
 
        log_daemon_msg "Stopping nova compute" "nova-instancemonitor"
52
 
        start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
53
 
        log_end_msg $?
54
 
;;
55
 
restart|force-reload)
56
 
        test "$ENABLED" = "true" || exit 1
57
 
        $0 stop
58
 
        sleep 1
59
 
        $0 start
60
 
;;
61
 
status)
62
 
        test "$ENABLED" = "true" || exit 0
63
 
        status_of_proc -p $PIDFILE $DAEMON nova-instancemonitor && exit 0 || exit $?
64
 
;;
65
 
*)
66
 
        log_action_msg "Usage: $0 {start|stop|restart|force-reload|status}"
67
 
        exit 1
68
 
;;
69
 
esac
70
 
 
71
 
exit 0