3
# Provides: nova-instancemonitor
4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
6
# Default-Start: 2 3 4 5
8
# Short-Description: nova-instancemonitor
9
# Description: Monitor your virtual machine resource usages
14
DAEMON=/usr/bin/nova-instancemonitor
15
DAEMON_ARGS="--flagfile=/etc/nova/nova.conf"
16
PIDFILE=/var/run/nova/nova-instancemonitor.pid
20
if test -f /etc/default/nova-instancemonitor; then
21
. /etc/default/nova-instancemonitor
24
mkdir -p /var/run/nova
25
chown nova:root /var/run/nova
27
mkdir -p /var/lock/nova
28
chown nova:root /var/lock/nova
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"
34
. /lib/lsb/init-functions
36
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
38
if ! [ -x ${DAEMON} ] ; then
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}
50
test "$ENABLED" = "true" || exit 0
51
log_daemon_msg "Stopping nova compute" "nova-instancemonitor"
52
start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
56
test "$ENABLED" = "true" || exit 1
62
test "$ENABLED" = "true" || exit 0
63
status_of_proc -p $PIDFILE $DAEMON nova-instancemonitor && exit 0 || exit $?
66
log_action_msg "Usage: $0 {start|stop|restart|force-reload|status}"