Init scripts for Quantum
Bug #885483 reported by
Brad Hall
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
High
|
Brad Hall |
Bug Description
We need to create init scripts for both rhel and debian based distros that will start Quantum from /etc/init.d. The init scripts should also configure Quantum to log to /var/log/quantum so that we have a canonical location for finding the Quantum server logs.
Changed in quantum: | |
importance: | Undecided → High |
assignee: | nobody → Brad Hall (bgh) |
status: | New → Confirmed |
milestone: | none → essex-2 |
Changed in quantum: | |
status: | Fix Committed → Fix Released |
Changed in quantum: | |
milestone: | essex-1 → 2012.1 |
To post a comment you must log in.
I have a diff for this but it is stacked on top of Tyler's packaging changes. I'll wait until those are submitted before submitting this.
commit 3fe3f17fe6802f6 834ce0335ab86a0 37f362baaf
Author: Brad Hall <email address hidden>
Date: Wed Nov 2 16:23:36 2011 -0700
Add debian init file for quantum-server
diff --git a/server/ debian/ quantum- server. init b/server/ debian/ quantum- server. init debian/ quantum- server. init /var/run/ quantum/ quantum- server. pid /var/log/ quantum/ quantum- server. log /usr/bin/ quantum- server ARGS="- -log-file= $LOGFILE" DIR=/var/ run quantum- server; then quantum- server init-functions {PATH:+ $PATH:} /usr/sbin: /sbin" /var/lib/ quantum/ tmp force-reload) d/quantum- server {start| stop|restart| force-reload| status} "
new file mode 100644
index 0000000..f526868
--- /dev/null
+++ b/server/
@@ -0,0 +1,68 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: quantum-server
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: quantum-server
+# Description: Provides the Quantum networking service
+### END INIT INFO
+
+set -e
+
+PIDFILE=
+LOGFILE=
+
+DAEMON=
+DAEMON_
+DAEMON_
+
+ENABLED=true
+
+if test -f /etc/default/
+ . /etc/default/
+fi
+
+mkdir -p /var/run/quantum
+mkdir -p /var/log/quantum
+
+. /lib/lsb/
+
+export PATH="$
+export TMPDIR=
+
+if [ ! -x ${DAEMON} ] ; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ test "$ENABLED" = "true" || exit 0
+ log_daemon_msg "Starting quantum server" "quantum-server"
+ start-stop-daemon -Sbmv --pidfile $PIDFILE --chdir $DAEMON_DIR --exec $DAEMON -- $DAEMON_ARGS
+ log_end_msg $?
+ ;;
+ stop)
+ test "$ENABLED" = "true" || exit 0
+ log_daemon_msg "Stopping quantum server" "quantum-server"
+ start-stop-daemon --stop --oknodo --pidfile ${PIDFILE}
+ log_end_msg $?
+ ;;
+ restart|
+ test "$ENABLED" = "true" || exit 1
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ test "$ENABLED" = "true" || exit 0
+ status_of_proc -p $PIDFILE $DAEMON quantum-server && exit 0 || exit $?
+ ;;
+ *)
+ log_action_msg "Usage: /etc/init.
+ exit 1
+ ;;
+esac
+
+exit 0