diff options
| author | Mihai Prica <prica.mihai@gmail.com> | 2013-06-11 14:25:30 +0300 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2013-08-28 18:41:56 -0400 |
| commit | 14d719dc08ffada0629194ae871dbb0e0a9d3026 (patch) | |
| tree | e3c2700009536f7eea79712f2235d9e4f8decb8a /meta-openstack/recipes-devtools/python/python-glance | |
| parent | 461b1f2cc764f7e2fcf6669de3a59493de41333a (diff) | |
| download | meta-cloud-services-14d719dc08ffada0629194ae871dbb0e0a9d3026.tar.gz | |
python-nova: Added initscript
Signed-off-by: Mihai Prica <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-glance')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-glance/glance.init | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance.init b/meta-openstack/recipes-devtools/python/python-glance/glance.init new file mode 100644 index 0000000..7a269d6 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-glance/glance.init | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: | ||
| 5 | # Required-Start: $remote_fs $network $syslog | ||
| 6 | # Required-Stop: $remote_fs $syslog | ||
| 7 | # Default-Stop: 0 1 6 | ||
| 8 | # Short-Description: Glance API server | ||
| 9 | # Description: OpenStack Image Service (code-named Glance) API server | ||
| 10 | ### END INIT INFO | ||
| 11 | |||
| 12 | SUFFIX=@suffix@ | ||
| 13 | DESC="glance-$SUFFIX" | ||
| 14 | DAEMON="/usr/bin/glance-$SUFFIX" | ||
| 15 | CONFIG="/etc/glance/glance-$SUFFIX.conf" | ||
| 16 | PIDFILE="/var/run/glance-$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 | -- --config-file $CONFIG | ||
| 36 | |||
| 37 | if [ $? -eq 0 ]; then | ||
| 38 | echo "done." | ||
| 39 | else | ||
| 40 | echo "failed." | ||
| 41 | fi | ||
| 42 | } | ||
| 43 | |||
| 44 | stop() | ||
| 45 | { | ||
| 46 | echo -n "Stopping $DESC..." | ||
| 47 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 48 | if [ $? -eq 0 ]; then | ||
| 49 | echo "done." | ||
| 50 | else | ||
| 51 | echo "failed." | ||
| 52 | fi | ||
| 53 | rm -f $PIDFILE | ||
| 54 | } | ||
| 55 | |||
| 56 | case "$1" in | ||
| 57 | start) | ||
| 58 | start | ||
| 59 | ;; | ||
| 60 | stop) | ||
| 61 | stop | ||
| 62 | ;; | ||
| 63 | restart|force-reload) | ||
| 64 | stop | ||
| 65 | start | ||
| 66 | ;; | ||
| 67 | *) | ||
| 68 | echo "Usage: $0 {start|stop|force-reload|restart}" | ||
| 69 | exit 1 | ||
| 70 | ;; | ||
| 71 | esac | ||
| 72 | |||
| 73 | exit 0 | ||
