From ed35052af0f8ba789f3b65b63573f841a3a9530b Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 9 Oct 2008 22:21:40 +0200 Subject: [PATCH] Fix connscheduler reconnect --- doc/packages-list.txt | 3 ++- src/initscripts/init.d/networking/red | 7 ++----- src/scripts/connscheduler | 14 +++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 8b70cd3def..6866342a61 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -1,4 +1,4 @@ -== List of softwares used to build IPFire Version: 2.3-beta4 == +== List of softwares used to build IPFire Version: 2.3-test == * Archive-Tar-1.29 * Archive-Zip-1.16 * BerkeleyDB-0.27 @@ -231,6 +231,7 @@ * openswan-2.4.12 * openswan-2.4.12-kmod * openvpn-2.0.9 +* p7zip_4.58 * pam_mysql-0.7RC1 * patch-2.5.4 * pciutils-2.2.3 diff --git a/src/initscripts/init.d/networking/red b/src/initscripts/init.d/networking/red index 5efb5cab2d..b3347eb631 100644 --- a/src/initscripts/init.d/networking/red +++ b/src/initscripts/init.d/networking/red @@ -374,11 +374,7 @@ case "${1}" in boot_mesg -n "LEASEINFO Test failed! - " ${WARNING} boot_mesg "dhcpcd is not running!" ${WARNING} echo_warning - exit 1 fi - - ## Disable vnstat collection - /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1 elif [ "$TYPE" == "PPPOE" ]; then boot_mesg "Bringing down the PPP interface ..." @@ -401,10 +397,11 @@ case "${1}" in fi killall -w -s KILL /usr/sbin/pppd >/dev/null 2>&1 killall -w -s KILL br2684ctl >/dev/null 2>&1 - rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} ## Disable vnstat collection /usr/bin/vnstat -u -i ${DEVICE} -r --disable > /dev/null 2>&1 + + rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} exit 0; ;; esac diff --git a/src/scripts/connscheduler b/src/scripts/connscheduler index 8c7f17f0f1..f513cf45d4 100644 --- a/src/scripts/connscheduler +++ b/src/scripts/connscheduler @@ -77,10 +77,13 @@ sub hangup } # now wait for active triggerfile and ppp daemon to disappear + # wait maximum 60 seconds + my $counter = 60; sleep 1; - while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' ) + while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 ) { sleep 1; + $counter--; } } @@ -113,6 +116,15 @@ sub dial sub reconnect { &hangup() if ( -e "${General::swroot}/red/active" ); + # now wait for active triggerfile and ppp daemon to disappear + # wait maximum 60 seconds + my $counter = 60; + sleep 1; + while ( -e "${General::swroot}/red/active" || -e '/var/run/ppp-ipfire.pid' || $counter == 0 ) + { + sleep 1; + $counter--; + } &dial(); } -- 2.39.2