diff options
author | Ermal <eri@pfsense.org> | 2010-06-04 15:57:08 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-06-04 15:57:08 +0000 |
commit | 956950dea4f933af197b061b5e32a527544e375c (patch) | |
tree | 30567961663a07296a5b9ce76d29193067b139b3 /etc | |
parent | 922693e929f4589d719a58bfd4986d8a1572debb (diff) | |
download | pfsense-956950dea4f933af197b061b5e32a527544e375c.zip pfsense-956950dea4f933af197b061b5e32a527544e375c.tar.gz |
Fixes #374. Actually reload teh dhcpleases utility whenever the hosts files is regenerated to avoid problems.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/services.inc | 23 | ||||
-rw-r--r-- | etc/inc/system.inc | 13 | ||||
-rwxr-xr-x | etc/rc.bootup | 3 |
3 files changed, 13 insertions, 26 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 013351b..94f69cd 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -38,26 +38,6 @@ pfSense_MODULE: utils */ -function services_parse_dhcpd_hostnames() { - global $g, $config; - - // Launch if option enabled - if (isset($config['dnsmasq']['regdhcp'])) { - /* Make sure we do not error out */ - @touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases"); - if (!file_exists("{$g['varetc_path']}/hosts")) - system_hosts_generate(); - if (file_exists("{$g['varrun_path']}/dhcpleases.pid")) - sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP"); - else - mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts"); - } else { - sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM"); - @unlink("{$g['varrun_path']}/dhcpleases.pid"); - } - -} - function services_dhcpd_configure() { global $config, $g; @@ -648,9 +628,6 @@ function services_dnsmasq_configure() { $return = 1; } - // restart isc-dhcpd parser - services_parse_dhcpd_hostnames(); - return $return; } diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 75e3f6d..a7c3423 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -225,6 +225,19 @@ function system_hosts_generate() { fwrite($fd, $hosts); fclose($fd); + /* Start the monitoring process for dynamic dhcpclients. */ + if (isset($config['dnsmasq']['regdhcp'])) { + /* Make sure we do not error out */ + @touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases"); + if (file_exists("{$g['varrun_path']}/dhcpleases.pid")) + sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "HUP"); + else + mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$syscfg['domain']} -p {$g['varrun_path']}/dnsmasq.pid -h {$g['varetc_path']}/hosts"); + } else { + sigkillbypid("{$g['varrun_path']}/dhcpleases.pid", "TERM"); + @unlink("{$g['varrun_path']}/dhcpleases.pid"); + } + return 0; } diff --git a/etc/rc.bootup b/etc/rc.bootup index 858ea2e..4f67a7b 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -329,9 +329,6 @@ enable_rrd_graphing(); /* start DHCP service */ services_dhcpd_configure(); -/* start DHCP logging service which populates /etc/hosts */ -services_parse_dhcpd_hostnames(); - /* startup OLSR if needed */ setup_wireless_olsr(); |