Bug #3404 » services.inc.patch
| services-fixed.inc 2014-01-22 11:34:24.000000000 -0600 | ||
|---|---|---|
| 320 | 320 |
fclose($fd); |
| 321 | 321 |
mwexec("/bin/sh {$g['tmp_path']}/dhcpd.sh");
|
| 322 | 322 | |
| 323 |
/* Ensure all enable interfaces with enabled DHCP servers are running before starting dhcpd */ |
|
| 324 |
foreach($config['dhcpd'] as $ifdescr => $ifname) {
|
|
| 325 |
if(isset($config['dhcpd'][$ifdescr]['enable']) && isset($config['interfaces'][$ifdescr]['enable'])) {
|
|
| 326 |
$i = 0; |
|
| 327 |
while($i < 10) {
|
|
| 328 |
exec("/sbin/ifconfig {$config['interfaces'][$ifdescr]['if']} | grep 'UP' 2>&1", $out, $ret);
|
|
| 329 |
if($ret == 0) |
|
| 330 |
break; |
|
| 331 |
log_error("DHCP server enabled and configured on {$config['interfaces'][$ifdescr]['if']} but interface is not up, waiting 1 second and trying again. \n");
|
|
| 332 |
sleep(1); |
|
| 333 |
$i++; |
|
| 334 |
} |
|
| 335 |
} |
|
| 336 |
} |
|
| 337 | ||
| 323 | 338 |
if ($family == "all" || $family == "inet") |
| 324 | 339 |
services_dhcpdv4_configure(); |
| 325 | 340 |
if ($family == "all" || $family == "inet6") {
|