diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-11-27 20:41:10 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-11-27 20:41:10 +0000 |
commit | d7a6517a4bf23188d37dfa60d9314437275d6343 (patch) | |
tree | 74b2c5926940b32e0da46b470129aa4b1da357a0 /etc/inc/interfaces.inc | |
parent | 528df9a78e17a9c7acfddff1e3c50696e3a24228 (diff) | |
download | pfsense-d7a6517a4bf23188d37dfa60d9314437275d6343.zip pfsense-d7a6517a4bf23188d37dfa60d9314437275d6343.tar.gz |
MFC 8080
* Do not process hotplug events from pppoe
* Cleanup kill by pid function, accept a real pid (dhclient depends on this)
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 1e53eaf..b6ad801 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -690,11 +690,14 @@ function interfaces_wan_configure() { /* find dhclient process for wan and kill it */ killbypid(find_dhclient_process("wan")); + /* remove wanup file if it exists */ + unlink_if_exists("{$g['tmp_path']}/wanup"); + /* kill PPPoE client (mpd) */ killbypid("{$g['varrun_path']}/mpd.pid"); /* wait for processes to die */ - sleep(1); + sleep(3); unlink_if_exists("{$g['varetc_path']}/dhclient_wan.conf"); unlink_if_exists("{$g['varetc_path']}/mpd.conf"); @@ -1073,24 +1076,27 @@ EOD; fwrite($fd, $mpdconf); fclose($fd); - - /* if mpd is active, lets take it down */ - if(file_exists("{$g['varrun_path']}/mpd.pid")) { - killbypid(file_get_contents("{$g['varrun_path']}/mpd.pid")); - sleep(1); + + if(file_exists("{$g['varrun_path']}/mpd.pid") and $g['booting']) { + /* if we are booting and mpd has already been started then don't start again. */ + } else { + /* if mpd is active, lets take it down */ + if(file_exists("{$g['varrun_path']}/mpd.pid")) { + killbypid("{$g['varrun_path']}/mpd.pid"); + sleep(3); + } + /* fire up mpd */ + mwexec("/usr/local/sbin/mpd -b -d {$g['varetc_path']} -p {$g['varrun_path']}/mpd.pid pppoe"); } - /* fire up mpd */ - mwexec("/usr/local/sbin/mpd -b -d {$g['varetc_path']} -p {$g['varrun_path']}/mpd.pid pppoe"); - /* sleep until wan is up - or 30 seconds, whichever comes first */ for ($count = 0; $count < 30; $count++) { if(file_exists("{$g['tmp_path']}/wanup")) { break; } - sleep(1); } + unlink_if_exists("{$g['tmp_path']}/wanup"); return 0; @@ -1420,4 +1426,4 @@ function discover_bridge($interface1, $interface2) { return "-1"; } -?> +?>
\ No newline at end of file |