rc-scripts/trunk/rc.d/rc.shutdown
arekm
cvs at pld-linux.org
Sun May 7 19:25:56 CEST 2006
Author: arekm
Date: Sun May 7 19:25:51 2006
New Revision: 7392
Modified:
rc-scripts/trunk/rc.d/rc.shutdown
Log:
Speedup shutdown (glen).
Modified: rc-scripts/trunk/rc.d/rc.shutdown
==============================================================================
--- rc-scripts/trunk/rc.d/rc.shutdown (original)
+++ rc-scripts/trunk/rc.d/rc.shutdown Sun May 7 19:25:51 2006
@@ -30,9 +30,19 @@
runlevel=$1
previous=$2
-run_cmd "Sending all processes the TERM signal" killall5 -15
-sleep 5
-run_cmd "Sending all processes the KILL signal" killall5 -9
+# check for other processes.
+# there could be none if all services were terminated properly
+# pgrep -g 0 requires procps >= 3.2.6-1.1
+pids=$(pgrep -g 0 -l -v | grep -v '^1 ')
+if [ -n "$pids" ]; then
+ run_cmd "Sending all processes the TERM signal" killall5 -15
+fi
+
+pids=$(pgrep -g 0 -l -v | grep -v '^1 ')
+if [ -n "$pids" ]; then
+ sleep 5
+ run_cmd "Sending all processes the KILL signal" killall5 -9
+fi
# Write to wtmp file before unmounting /var
halt -w
More information about the pld-cvs-commit
mailing list