File openstack-nova-vncproxy.init of Package openstack-nova
#!/bin/sh
### BEGIN INIT INFO
# Provides: openstack-nova-vncproxy
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: rabbitmq-server mysql postgresql
# Should-Stop: rabbitmq-server mysql postgresql
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Nova vncproxy server
# Description: Nova vncproxy server.
### END INIT INFO
name="vncproxy"
USER="nova"
GROUP="nobody"
CONFIGFILE="/etc/nova/nova.conf"
RUNDIR="/var/run/nova"
LOGFILE="/var/log/nova/$name.log"
[ -e "/etc/sysconfig/openstack-nova-$name" ] && . "/etc/sysconfig/openstack-nova-$name"
# $RUNDIR can be tmpfs, thus we have to create/own it here:
mkdir -m 0700 -p $RUNDIR && chown $USER. $RUNDIR
DAEMON="/usr/bin/nova-xvpvncproxy"
DAEMON_OPTIONS="--config-file=$CONFIGFILE --logfile=$LOGFILE"
OPTIONS="${OPTIONS} $DAEMON_OPTIONS"
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v be verbose in local rc status and clear it afterwards
# rc_status -v -r ditto and clear both the local and overall rc status
# rc_status -s display "skipped" and exit with status 3
# rc_status -u display "unused" and exit with status 3
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear both the local and overall rc status
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by symlinks
. /etc/rc.status
FULLNAME="OpenStack::Nova $name server"
CHUSER="-u $USER"
case "$1" in
start)
echo -n "Starting $FULLNAME"
startproc -s $CHUSER -t ${STARTUP_TIMEOUT:-5} -q $DAEMON $OPTIONS
rc_status -v
;;
stop)
echo -n "Shutting down $FULLNAME"
killproc $DAEMON
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
;;
status)
echo -n "Checking $FULLNAME"
/sbin/checkproc $DAEMON
rc_status -v
;;
condrestart|try-restart)
$0 restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}"
exit 2
esac
exit $?