diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-03-17 14:14:48 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-03-17 15:27:41 -0400 |
| commit | 9a74961bafabc404f015fc5d8a9da969d263dad3 (patch) | |
| tree | edc0caa250166b128c89f606d17373c75e233d26 /meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth | |
| parent | 71ef5b7acb5815c678cda0c115e98e6b1d06e1aa (diff) | |
| download | meta-cloud-services-9a74961bafabc404f015fc5d8a9da969d263dad3.tar.gz | |
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 <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth | 19 |
1 files changed, 16 insertions, 3 deletions
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 | |||
| 43 | exit 0 | 43 | exit 0 |
| 44 | fi | 44 | fi |
| 45 | 45 | ||
| 46 | DESC="nova console" | ||
| 47 | status() | ||
| 48 | { | ||
| 49 | pid=`cat $PIDFILE 2>/dev/null` | ||
| 50 | if [ -n "$pid" ]; then | ||
| 51 | if ps -p $pid >&- ; then | ||
| 52 | echo "$DESC is running" | ||
| 53 | return | ||
| 54 | fi | ||
| 55 | fi | ||
| 56 | echo "$DESC is not running" | ||
| 57 | } | ||
| 58 | |||
| 46 | case "$1" in | 59 | case "$1" in |
| 47 | start) | 60 | start) |
| 48 | test "$ENABLED" = "true" || exit 0 | 61 | test "$ENABLED" = "true" || exit 0 |
| @@ -56,7 +69,7 @@ case "$1" in | |||
| 56 | start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} | 69 | start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} |
| 57 | log_end_msg $? | 70 | log_end_msg $? |
| 58 | ;; | 71 | ;; |
| 59 | restart|force-reload) | 72 | restart|force-reload|reload) |
| 60 | test "$ENABLED" = "true" || exit 1 | 73 | test "$ENABLED" = "true" || exit 1 |
| 61 | $0 stop | 74 | $0 stop |
| 62 | sleep 1 | 75 | sleep 1 |
| @@ -64,10 +77,10 @@ case "$1" in | |||
| 64 | ;; | 77 | ;; |
| 65 | status) | 78 | status) |
| 66 | test "$ENABLED" = "true" || exit 0 | 79 | test "$ENABLED" = "true" || exit 0 |
| 67 | status_of_proc -p $PIDFILE $DAEMON nova-consoleauth && exit 0 || exit $? | 80 | status |
| 68 | ;; | 81 | ;; |
| 69 | *) | 82 | *) |
| 70 | echo "Usage: /etc/init.d/nova-consoleauth {start|stop|restart|force-reload|status}" | 83 | echo "Usage: /etc/init.d/nova-consoleauth {start|stop|restart|force-reload|status|reload|status}" |
| 71 | exit 1 | 84 | exit 1 |
| 72 | ;; | 85 | ;; |
| 73 | esac | 86 | esac |
