summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/system.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/inc/system.inc')
-rw-r--r--src/etc/inc/system.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 8ba9265..58ebc7a 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -477,6 +477,8 @@ function system_hosts_generate() {
function system_dhcpleases_configure() {
global $config, $g;
+ $pidfile = "{$g['varrun_path']}/dhcpleases.pid";
+
/* Start the monitoring process for dynamic dhcpclients. */
if ((isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcp'])) ||
(isset($config['unbound']['enable']) && isset($config['unbound']['regdhcp']))) {
@@ -494,7 +496,6 @@ function system_dhcpleases_configure() {
$unbound_conf = "";
}
- $pidfile = "{$g['varrun_path']}/dhcpleases.pid";
if (isvalidpid($pidfile)) {
/* Make sure dhcpleases is using correct unbound or dnsmasq */
$_gb = exec("/bin/pgrep -F {$pidfile} -f {$dns_pid}", $output, $retval);
@@ -512,7 +513,7 @@ function system_dhcpleases_configure() {
}
@unlink($pidfile);
mwexec("/usr/local/sbin/dhcpleases -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases -d {$config['system']['domain']} -p {$g['varrun_path']}/{$dns_pid} {$unbound_conf} -h {$g['varetc_path']}/hosts");
- } else {
+ } elseif (isvalidpid($pidfile)) {
sigkillbypid($pidfile, "TERM");
@unlink($pidfile);
}
OpenPOWER on IntegriCloud