diff options
| author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-18 14:28:38 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-11-25 15:25:38 -0500 |
| commit | 73d5afa1581566b00ae116034c958ab85f5b35fd (patch) | |
| tree | f58ce4186f9c5eb03250b5e2fad42933ca35ae8f /meta-openstack/recipes-devtools/python/python-nova/nova.init | |
| parent | 7b5bba81e957c4107c02f71b0d41b0a3f035385f (diff) | |
| download | meta-cloud-services-73d5afa1581566b00ae116034c958ab85f5b35fd.tar.gz | |
nova: generate per-service initscripts
Rather than use the catch-all "nova-all" initscript, we switch to
one initscript per-service. The old nova-all is still installed, but
not linked as an initscript, so it can be used as a fallback.
In addition to per-service initscripts, we switch to generating those
initscripts from a common template script.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova.init')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/nova.init | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.init b/meta-openstack/recipes-devtools/python/python-nova/nova.init new file mode 100644 index 0000000..3a2bbac --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-nova/nova.init | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: nova-compute | ||
| 5 | # Required-Start: $remote_fs $syslog | ||
| 6 | # Required-Stop: $remote_fs $syslog | ||
| 7 | # Default-Start: 3 5 | ||
| 8 | # Default-Stop: 0 1 2 6 | ||
| 9 | # Short-Description: OpenStack Compute (Nova) - @suffix@ | ||
| 10 | # Description: OpenStack Compute (Nova) - @suffix@ | ||
| 11 | ### END INIT INFO | ||
| 12 | |||
| 13 | SUFFIX="@suffix@" | ||
| 14 | DESC="nova-@suffix@" | ||
| 15 | DAEMON="/usr/bin/nova-$SUFFIX" | ||
| 16 | PIDFILE="/var/run/nova-$SUFFIX.pid" | ||
| 17 | |||
| 18 | start () | ||
| 19 | { | ||
| 20 | if [ -e $PIDFILE ]; then | ||
| 21 | PIDDIR=/proc/$(cat $PIDFILE) | ||
| 22 | if [ -d ${PIDDIR} ]; then | ||
| 23 | echo "$DESC already running." | ||
| 24 | exit 1 | ||
| 25 | else | ||
| 26 | echo "Removing stale PID file $PIDFILE" | ||
| 27 | rm -f $PIDFILE | ||
| 28 | fi | ||
| 29 | fi | ||
| 30 | |||
| 31 | echo -n "Starting $DESC..." | ||
| 32 | |||
| 33 | start-stop-daemon --start --quiet --background \ | ||
| 34 | --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} | ||
| 35 | |||
| 36 | if [ $? -eq 0 ]; then | ||
| 37 | echo "done." | ||
| 38 | else | ||
| 39 | echo "failed." | ||
| 40 | fi | ||
| 41 | } | ||
| 42 | |||
| 43 | stop () | ||
| 44 | { | ||
| 45 | echo -n "Stopping $DESC..." | ||
| 46 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 47 | if [ $? -eq 0 ]; then | ||
| 48 | echo "done." | ||
| 49 | else | ||
| 50 | echo "failed." | ||
| 51 | fi | ||
| 52 | rm -f $PIDFILE | ||
| 53 | } | ||
| 54 | |||
| 55 | case "$1" in | ||
| 56 | start) | ||
| 57 | start | ||
| 58 | ;; | ||
| 59 | stop) | ||
| 60 | stop | ||
| 61 | ;; | ||
| 62 | restart|force-reload) | ||
| 63 | stop | ||
| 64 | start | ||
| 65 | ;; | ||
| 66 | *) | ||
| 67 | echo "Usage: $0 {start|stop|force-reload|restart}" | ||
| 68 | exit 1 | ||
| 69 | ;; | ||
| 70 | esac | ||
| 71 | |||
| 72 | exit 0 | ||
