From 7fc5dfc1f38ae953e552c432fe38445f7c712594 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Tue, 2 Mar 2010 11:43:02 -0300 Subject: [PATCH] Delayed network stop. Skip stopping network rc-script in main loop, and stop before killall5. This fixes for example, ssh session hang on reboot/shutdown. Signed-off-by: Gerardo Exequiel Pozzi --- rc.shutdown | 6 ++++-- rc.single | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index e34d570..3cf2bb7 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -27,7 +27,7 @@ fi # Find daemons NOT in the DAEMONS array. Shut these down first if [ -d /var/run/daemons ]; then for daemon in $(/bin/ls -1t /var/run/daemons); do - if ! in_array $daemon ${DAEMONS[@]}; then + if ! in_array $daemon ${DAEMONS[@]} && [ $daemon != "network" ]; then stop_daemon $daemon fi done @@ -35,7 +35,7 @@ fi # Shutdown daemons in reverse order let i=${#DAEMONS[@]}-1 while [ $i -ge 0 ]; do - if [ "${DAEMONS[$i]:0:1}" != '!' ]; then + if [ "${DAEMONS[$i]:0:1}" != '!' ] && [ "${DAEMONS[$i]#@}" != "network" ]; then ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@} fi let i=i-1 @@ -55,6 +55,8 @@ stat_done run_hook shutdown_postkillall +ck_daemon network || stop_daemon network + stat_busy "Saving Random Seed" RANDOM_SEED=/var/lib/misc/random-seed [ -d $(dirname $RANDOM_SEED) ] || mkdir -p $(dirname $RANDOM_SEED) diff --git a/rc.single b/rc.single index e8b6f08..b7ad635 100755 --- a/rc.single +++ b/rc.single @@ -13,7 +13,7 @@ if [ "$PREVLEVEL" != "N" ]; then # Find daemons NOT in the DAEMONS array. Shut these down first if [ -d /var/run/daemons ]; then for daemon in $(/bin/ls -1t /var/run/daemons); do - if ! in_array $daemon ${DAEMONS[@]}; then + if ! in_array $daemon ${DAEMONS[@]} && [ $daemon != "network" ]; then stop_daemon $daemon fi done @@ -21,7 +21,7 @@ if [ "$PREVLEVEL" != "N" ]; then # Shutdown daemons in reverse order let i=${#DAEMONS[@]}-1 while [ $i -ge 0 ]; do - if [ "${DAEMONS[$i]:0:1}" != '!' ]; then + if [ "${DAEMONS[$i]:0:1}" != '!' ] && [ "${DAEMONS[$i]#@}" != "network" ]; then ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@} fi let i=i-1 @@ -41,6 +41,8 @@ if [ "$PREVLEVEL" != "N" ]; then run_hook single_postkillall +ck_daemon network || stop_daemon network + stat_busy "Starting UDev Daemon" /sbin/udevd --daemon stat_done -- 1.7.0.1