From 87752445f58be6a806ff452fa24bf4388393a973 Mon Sep 17 00:00:00 2001 From: Faiyaz Ahmed Date: Wed, 17 Oct 2007 20:10:20 +0000 Subject: [PATCH] To kill nm procs that are defunct and won't die normall and also to kill nm procs that are in vservers but won't exit. --- nm.init | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/nm.init b/nm.init index ff6b000..5ba44e8 100755 --- a/nm.init +++ b/nm.init @@ -43,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() @@ -54,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.43.0