File openstack-quantum.init of Package openstack-quantum

#! /bin/sh
### BEGIN INIT INFO
# Provides:          quantum-server
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 5
# Default-Stop:      0 1 6
# Short-Description: quantum-server
# Description:       Provides the Quantum networking service
### END INIT INFO

QUANTUM_LOGFILE="/var/log/quantum/quantum-server.log"
QUANTUM_SYSCONFIG=/etc/sysconfig/quantum
test -r $QUANTUM_SYSCONFIG || exit 6
. $QUANTUM_SYSCONFIG

USER="openstack-quantum"
DAEMON=/usr/bin/quantum-server
DAEMON_ARGS="--log-file=$QUANTUM_LOGFILE --config-file=/etc/quantum/quantum.conf --config-file=$QUANTUM_PLUGIN_CONF"
DAEMON_DIR=/var/run

export TMPDIR=/var/lib/quantum/tmp

if [ ! -x ${DAEMON} ] ; then
	exit 0
fi

. /etc/rc.status

case "$1" in
  start)
    echo -n "Checking for DB Migrations"
    /usr/bin/quantum-db-manage check_migration
    rc_status -v
 
    echo -n "Starting quantum server"
    startproc -t ${STARTUP_TIMEOUT:-5} -q -s -u $USER $DAEMON $DAEMON_ARGS
    rc_status -v
    ;;
  stop)
    echo -n "Stopping quantum server"
    killproc $DAEMON
    rc_status -v
    ;;
  restart|force-reload)
    $0 stop
    sleep 1
    $0 start
    ;;
  reload)
    ;;
  status)
    echo -n "Checking status of quantum server"
    /sbin/checkproc $DAEMON
    rc_status -v
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart|force-reload|status}"
    exit 2
    ;;
esac

exit $?
openSUSE Build Service is sponsored by