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 --- .../recipes-devtools/python/python-heat/heat.init | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-heat/heat.init') diff --git a/meta-openstack/recipes-devtools/python/python-heat/heat.init b/meta-openstack/recipes-devtools/python/python-heat/heat.init index a7a168d..e37c4c8 100644 --- a/meta-openstack/recipes-devtools/python/python-heat/heat.init +++ b/meta-openstack/recipes-devtools/python/python-heat/heat.init @@ -64,6 +64,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 @@ -71,12 +83,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