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/inc/system.inc | |
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/inc/system.inc')
-rw-r--r-- | etc/inc/system.inc | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |