diff options
author | Bill Nottingham <notting@redhat.com> | 2009-09-21 13:27:41 -0400 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2009-09-21 13:27:41 -0400 |
commit | 8b87ac94acf67ee6c66530716ba0e74498047241 (patch) | |
tree | ed2e0c494435b8f28b732b6e7fd968fa4ea7a61a | |
parent | 970ccd69d57469c4d5b9fceed0a200965fabe2a8 (diff) | |
download | initscripts-8b87ac94acf67ee6c66530716ba0e74498047241.tar initscripts-8b87ac94acf67ee6c66530716ba0e74498047241.tar.gz initscripts-8b87ac94acf67ee6c66530716ba0e74498047241.tar.bz2 initscripts-8b87ac94acf67ee6c66530716ba0e74498047241.tar.xz initscripts-8b87ac94acf67ee6c66530716ba0e74498047241.zip |
Use halt's return code to avoid unnecessary sleeping. (#524359, <hdegoede@redhat.com>)
-rwxr-xr-x | rc.d/init.d/halt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 9d8bb152..e32188c2 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -67,8 +67,11 @@ for i in /dev/.mdadm/*.pid; do done action $"Sending all processes the TERM signal..." /sbin/killall5 -15 $OMITARGS -sleep 2 -action $"Sending all processes the KILL signal..." /sbin/killall5 -9 $OMITARGS +# No need to sleep and kill -9 if no processes to kill were found +if [ "$?" == 0 ]; then + sleep 2 + action $"Sending all processes the KILL signal..." /sbin/killall5 -9 $OMITARGS +fi # Write to wtmp file before unmounting /var /sbin/halt -w |