From ec4dd1f12eff5aab513845cafa87fbec8166adff Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Fri, 21 Mar 2014 17:07:29 -0400 Subject: OpenStack: nova-novncproxy:can't stop this service nova-novncproxy and nova-spicehtml5proxy both do not check to see if the process specified in PIDFILE exists before firing off a new one. Both initrd files can actually use nova.init (used for the many other nova-* daemons) nova-consoleauth also has this issue, we add a check in start to see if the process in PIDFILE exists and exits if it does. Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- .../python/python-nova/nova-consoleauth | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (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 56561db..d2c1f29 100644 --- a/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth +++ b/meta-openstack/recipes-devtools/python/python-nova/nova-consoleauth @@ -59,8 +59,27 @@ status() case "$1" in start) test "$ENABLED" = "true" || exit 0 + + if [ -e $PIDFILE ]; then + PIDDIR=/proc/$(cat $PIDFILE) + if [ -d ${PIDDIR} ]; then + echo "$DESC already running." + exit 1 + else + echo "Removing stale PID file $PIDFILE" + rm -f $PIDFILE + fi + fi + PIDDIR=`dirname $PIDFILE` + if [ ! -d $PIDDIR ]; then + mkdir -p $PIDDIR + chown nova $PIDDIR + fi + echo "Starting nova console" "nova-consoleauth" - start-stop-daemon --start -b -m --pidfile $PIDFILE --exec ${DAEMON} -- ${DAEMON_ARGS} + sudo -u nova \ + start-stop-daemon --start -b -m --pidfile $PIDFILE \ + --exec ${DAEMON} -- ${DAEMON_ARGS} log_end_msg $? ;; stop) -- cgit v1.2.3-54-g00ecf