#!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { need net } checkconfig() { if [ ! -r /etc/conf.d/quantum ]; then eerror "No Quantum Config found: /etc/conf.d/quantum)" return 1 fi # FIXME: might be nice to add some checks for proper /etc/quantum config files return 0 } start() { checkconfig || return $? PLUGINNAME=${SVCNAME#*-} if [[ $PLUGINNAME == "openvswitch-agent" || $PLUGINNAME == "server" ]]; then # Should we use a symlink to avoid this special case? CONFIGNAME="plugins/openvswitch/ovs_quantum_plugin" else CONFIGNAME=${PLUGINNAME//-/_} fi ebegin "Starting ${SVCNAME}" start-stop-daemon --start --background --make-pidfile \ --pidfile "${PID_PATH}/${SVCNAME}.pid" \ --exec /usr/bin/${SVCNAME} -- \ --config-file=/etc/quantum/quantum.conf --config-file=/etc/quantum/${CONFIGNAME}.ini \ --log-file=/var/log/quantum/${LOG_PATH}/${SVCNAME}.log eend $? "Failed to start ${SVCNAME}" } stop() { checkconfig || return $? ebegin "Stopping ${SVCNAME}" start-stop-daemon --stop --pidfile "${PID_PATH}/${SVCNAME}.pid" \ --exec /usr/bin/${SVCNAME} eend $? "Failed to stop ${SVCNAME}" }