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-novncproxy | |
| 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-novncproxy')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy b/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy index 76cd1df..c976194 100644 --- a/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy +++ b/meta-openstack/recipes-devtools/python/python-nova/nova-novncproxy | |||
| @@ -40,6 +40,19 @@ if ! [ -x ${DAEMON} ] ; then | |||
| 40 | exit 0 | 40 | exit 0 |
| 41 | fi | 41 | fi |
| 42 | 42 | ||
| 43 | DESC="nova vnc proxy" | ||
| 44 | status() | ||
| 45 | { | ||
| 46 | pid=`cat $PIDFILE 2>/dev/null` | ||
| 47 | if [ -n "$pid" ]; then | ||
| 48 | if ps -p $pid >&- ; then | ||
| 49 | echo "$DESC is running" | ||
| 50 | return | ||
| 51 | fi | ||
| 52 | fi | ||
| 53 | echo "$DESC is not running" | ||
| 54 | } | ||
| 55 | |||
| 43 | case "$1" in | 56 | case "$1" in |
| 44 | start) | 57 | start) |
| 45 | test "$ENABLED" = "true" || exit 0 | 58 | test "$ENABLED" = "true" || exit 0 |
| @@ -53,7 +66,7 @@ case "$1" in | |||
| 53 | start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} | 66 | start-stop-daemon --stop --oknodo --pidfile ${PIDFILE} |
| 54 | log_end_msg $? | 67 | log_end_msg $? |
| 55 | ;; | 68 | ;; |
| 56 | restart|force-reload) | 69 | restart|force-reload|reload) |
| 57 | test "$ENABLED" = "true" || exit 1 | 70 | test "$ENABLED" = "true" || exit 1 |
| 58 | $0 stop | 71 | $0 stop |
| 59 | sleep 1 | 72 | sleep 1 |
| @@ -61,10 +74,10 @@ case "$1" in | |||
| 61 | ;; | 74 | ;; |
| 62 | status) | 75 | status) |
| 63 | test "$ENABLED" = "true" || exit 0 | 76 | test "$ENABLED" = "true" || exit 0 |
| 64 | status_of_proc -p $PIDFILE $DAEMON nova-novncproxy && exit 0 || exit $? | 77 | status |
| 65 | ;; | 78 | ;; |
| 66 | *) | 79 | *) |
| 67 | echo "Usage: /etc/init.d/nova-novncproxy {start|stop|restart|force-reload|status}" | 80 | echo "Usage: /etc/init.d/nova-novncproxy {start|stop|restart|force-reload|status|reload|status}" |
| 68 | exit 1 | 81 | exit 1 |
| 69 | ;; | 82 | ;; |
| 70 | esac | 83 | esac |
