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-keystone/keystone | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-keystone') diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone b/meta-openstack/recipes-devtools/python/python-keystone/keystone index a5529df..463b05f 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone/keystone +++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone @@ -51,6 +51,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 @@ -58,12 +70,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