From 9a74961bafabc404f015fc5d8a9da969d263dad3 Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Mon, 17 Mar 2014 14:14:48 -0400 Subject: OpenStack: Add to missing functionality in sysvinit scripts Add status/reload to sysvinit scripts Modify tgtd to make start/stop work better (borrowed from Debian's implementation) Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- .../python/python-glance/glance.init | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-glance') diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance.init b/meta-openstack/recipes-devtools/python/python-glance/glance.init index c61abaa..def500f 100644 --- a/meta-openstack/recipes-devtools/python/python-glance/glance.init +++ b/meta-openstack/recipes-devtools/python/python-glance/glance.init @@ -4,6 +4,7 @@ # Provides: # Required-Start: $remote_fs $network $syslog # Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Glance API server # Description: OpenStack Image Service (code-named Glance) API server @@ -57,6 +58,18 @@ stop() rm -f $PIDFILE } +status() +{ + pid=`cat $PIDFILE 2>/dev/null` + if [ -n "$pid" ]; then + if ps -p $pid >&- ; then + echo "$DESC is running" + return + fi + fi + echo "$DESC is not running" +} + case "$1" in start) start @@ -64,12 +77,15 @@ case "$1" in stop) stop ;; - restart|force-reload) + restart|force-reload|reload) stop start ;; + status) + status + ;; *) - echo "Usage: $0 {start|stop|force-reload|restart}" + echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" exit 1 ;; esac -- cgit v1.2.3-54-g00ecf