To kill nm procs that are defunct and won't die normall and also to kill nm procs...
authorFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Oct 2007 20:10:20 +0000 (20:10 +0000)
committerFaiyaz Ahmed <faiyaza@cs.princeton.edu>
Wed, 17 Oct 2007 20:10:20 +0000 (20:10 +0000)
nm.init

diff --git a/nm.init b/nm.init
index ff6b000..5ba44e8 100755 (executable)
--- 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