diff options
Diffstat (limited to 'src/etc/inc/services.inc')
-rw-r--r-- | src/etc/inc/services.inc | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index f7aadd8..79a12db 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -610,6 +610,7 @@ EOD; $type = "secondary"; $my_port = "520"; $peer_port = "519"; + $dhcpdconf_pri = ''; } else { $my_port = "519"; $peer_port = "520"; @@ -1522,6 +1523,10 @@ EOD; $dhhostname = str_replace(" ", "_", $sm['hostname']); $dhhostname = str_replace(".", "_", $dhhostname); $dhcpdv6conf .= " option host-name {$dhhostname};\n"; + if (isset($dhcpv6ifconf['ddnsupdate']) && + isset($dhcpv6ifconf['ddnsforcehostname'])) { + $dhcpdv6conf .= " ddns-hostname \"{$dhhostname}\";\n"; + } } if ($sm['filename']) { $dhcpdv6conf .= " filename \"{$sm['filename']}\";\n"; @@ -2234,12 +2239,21 @@ function services_unbound_configure($restart_dhcp = true) { echo "services_unbound_configure() being called $mt\n"; } - // kill any running Unbound instance - if (file_exists("{$g['varrun_path']}/unbound.pid")) { - sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM"); - } - if (isset($config['unbound']['enable'])) { + require_once('/etc/inc/unbound.inc'); + + /* Stop Unbound using TERM */ + if (file_exists("{$g['varrun_path']}/unbound.pid")) { + sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM"); + } + + /* If unbound is still running, wait up to 30 seconds for it to terminate. */ + for ($i=1; $i <= 30; $i++) { + if (is_process_running('unbound')) { + sleep(1); + } + } + if (platform_booting()) { echo gettext("Starting DNS Resolver..."); } else { @@ -2251,13 +2265,35 @@ function services_unbound_configure($restart_dhcp = true) { $return = 1; } - require_once('/etc/inc/unbound.inc'); + /* Check here for dhcp6 complete - wait upto 10 seconds */ + if($config['interfaces']["wan"]['ipaddrv6'] == 'dhcp6') { + $wanif = get_real_interface("wan", "inet6"); + if (platform_booting()) { + for ($i=1; $i <= 10; $i++) { + if (!file_exists("/tmp/{$wanif}_dhcp6_complete")) { + log_error(gettext("Unbound start waiting on dhcp6c.")); + sleep(1); + } else { + unlink_if_exists("/tmp/{$wanif}_dhcp6_complete"); + log_error(gettext("dhcp6 init complete. Continuing")); + break; + } + } + } + } + sync_unbound_service(); if (platform_booting()) { + log_error(gettext("sync unbound done.")); echo gettext("done.") . "\n"; } system_dhcpleases_configure(); + } else { + /* kill Unbound since it should not be enabled */ + if (file_exists("{$g['varrun_path']}/unbound.pid")) { + sigkillbypid("{$g['varrun_path']}/unbound.pid", "KILL"); + } } if (!platform_booting() && $restart_dhcp) { @@ -2868,7 +2904,7 @@ function install_cron_job($command, $active = false, $minute = "0", $hour = "*", } } else { if ($is_installed == true) { - unset($config['cron']['item'][$x]); + array_splice($config['cron']['item'], $x, 1); $change_message = "Removed cron job for %s"; } else { $cron_changed = false; |