From 69095aa54f8cd75116fa64aaa7d7e36332f8b960 Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Wed, 17 Oct 2007 20:21:19 +0000 Subject: [PATCH] Kill defunct nm procs in vservers when stopping. --- nm.init | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/nm.init b/nm.init index 5d6a33c..5ba44e8 100755 --- a/nm.init +++ b/nm.init @@ -5,7 +5,6 @@ # chkconfig: 3 86 26 # description: Starts and stops Node Manager daemon # -# $Id$ # Source function library. . /etc/init.d/functions @@ -44,6 +43,10 @@ stop() RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile} + for i in $( vps aux | grep nm.py | awk '{print $2}' ); do + kill -9 $i + done + } restart() @@ -55,26 +58,26 @@ restart() case "$1" in start) - start - ;; + start + ;; stop) - stop - ;; + stop + ;; status) - status $nm - RETVAL=$? - ;; + status $nm + RETVAL=$? + ;; restart|reload) - restart - ;; + restart + ;; condrestart) - if [ -f ${pidfile} ] ; then - restart - fi - ;; + if [ -f ${pidfile} ] ; then + restart + fi + ;; *) - echo $"Usage: $0 {start|stop|restart|condrestart|status}" - exit 1 + echo $"Usage: $0 {start|stop|restart|condrestart|status}" + exit 1 esac exit 0 -- 2.47.0