3
3
# Provides: nova-objectstore
4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
4
# Required-Start: $network $local_fs $remote_fs $syslog
5
# Required-Stop: $remote_fs
6
6
# Default-Start: 2 3 4 5
7
7
# Default-Stop: 0 1 6
8
# Short-Description: nova-objectstore
9
# Description: provides virtual machine storage functionalities
8
# Short-Description: Nova Objectstore
9
# Description: Provides virtual machine storage functionalities
12
# Author: Julien Danjou <acid@debian.org>
14
# PATH should only include /usr/* if it runs after the mountnfs.sh script
15
PATH=/sbin:/usr/sbin:/bin:/usr/bin
16
DESC="OpenStack Compute Objectstore"
15
18
DAEMON=/usr/bin/nova-objectstore
16
19
DAEMON_ARGS="--flagfile=/etc/nova/nova.conf"
17
PIDFILE=/var/run/nova/nova-objectstore.pid
21
if test -f /etc/default/nova-objectstore; then
22
. /etc/default/nova-objectstore
25
mkdir -p /var/run/nova
26
chown nova:root /var/run/nova/
28
mkdir -p /var/lock/nova
29
chown nova:root /var/lock/nova/
31
uid="$(getent passwd nova | cut -f3 -d:)"
32
gid="$(getent passwd nova | cut -f4 -d:)"
20
PIDFILE=/var/run/$NAME.pid
21
SCRIPTNAME=/etc/init.d/$NAME
23
LOCK_DIR=/var/lock/nova/
25
# Exit if the package is not installed
26
[ -x $DAEMON ] || exit 0
29
chown ${NOVA_USER} ${LOCK_DIR}
31
# Read configuration variable file if it is present
32
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
34
34
. /lib/lsb/init-functions
36
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
38
start-stop-daemon --start --quiet --background --chuid ${NOVA_USER}:nova --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null \
40
start-stop-daemon --start --quiet --background --chuid ${NOVA_USER}:nova --make-pidfile --pidfile $PIDFILE --startas $DAEMON -- \
38
if ! [ -x ${DAEMON} ] ; then
47
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
44
test "$ENABLED" = "true" || exit 0
45
log_daemon_msg "Starting nova objectstore" "nova-objectstore"
46
start-stop-daemon --start --chdir /var/run --chuid ${uid}:${gid} -b -m --pidfile ${PIDFILE} --exec ${DAEMON} -- ${DAEMON_ARGS}
55
log_daemon_msg "Starting $DESC " "$NAME"
50
test "$ENABLED" = "true" || exit 0
51
log_daemon_msg "Stopping nova objectstore" "nova-objectstore"
52
start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
63
log_daemon_msg "Stopping $DESC" "$NAME"
71
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
55
73
restart|force-reload)
56
test "$ENABLED" = "true" || exit 1
62
test "$ENABLED" = "true" || exit 0
63
status_of_proc -p $PIDFILE $DAEMON nova-objectstore && exit 0 || exit $?
74
log_daemon_msg "Restarting $DESC" "$NAME"
81
1) log_end_msg 1 ;; # Old process is still running
82
*) log_end_msg 1 ;; # Failed to start
66
log_action_msg "Usage: /etc/init.d/nova-objectstore {start|stop|restart|force-reload|status}"
92
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2