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-nova/nova-consoleauth | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth') diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth index 13ad285..56561db 100644 --- a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth +++ b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth @@ -43,6 +43,19 @@ if ! [ -x ${DAEMON} ] ; then exit 0 fi +DESC="nova console" +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) test "$ENABLED" = "true" || exit 0 @@ -56,7 +69,7 @@ case "$1" in start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} log_end_msg $? ;; - restart|force-reload) + restart|force-reload|reload) test "$ENABLED" = "true" || exit 1 $0 stop sleep 1 @@ -64,10 +77,10 @@ case "$1" in ;; status) test "$ENABLED" = "true" || exit 0 - status_of_proc -p $PIDFILE $DAEMON nova-consoleauth && exit 0 || exit $? + status ;; *) - echo "Usage: /etc/init.d/nova-consoleauth {start|stop|restart|force-reload|status}" + echo "Usage: /etc/init.d/nova-consoleauth {start|stop|restart|force-reload|status|reload|status}" exit 1 ;; esac -- cgit v1.2.3-54-g00ecf