summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-12-18 14:57:42 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-12-18 14:57:42 -0500
commit42ee8bde8b3eaf041a8c3303c4bc71f612e25a53 (patch)
tree54f50740f46962d8acb8caf8d5384429cf806986
parentd64fa7f25478b66da1f17222f0a7fc5da080295b (diff)
downloadpfsense-42ee8bde8b3eaf041a8c3303c4bc71f612e25a53.zip
pfsense-42ee8bde8b3eaf041a8c3303c4bc71f612e25a53.tar.gz
Ensure log directory exists before invoking syslogd
-rw-r--r--etc/inc/services.inc1
-rw-r--r--etc/inc/system.inc5
2 files changed, 5 insertions, 1 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index ba52ee9..166390b 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -73,7 +73,6 @@ function services_dhcpd_configure() {
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n");
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n");
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/run\n");
- fwrite($fd, "touch {$g['dhcpd_chroot_path']}/var/run/log\n");
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n");
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n");
fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n");
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 9b07258..638cd6c 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -613,6 +613,11 @@ EOD;
}
fwrite($fd, $syslogconf);
fclose($fd);
+
+ // Ensure that the log directory exists
+ if(!isdir("{$g['dhcpd_chroot_path']}/var/run"))
+ exec("/bin/mkdir -p {$g['dhcpd_chroot_path']}/var/run");
+
// Are we logging to a least one remote server ?
if(strpos($syslogconf, "@") != false)
$retval = system("/usr/sbin/syslogd -c -c -l /var/dhcpd/var/run/log -f {$g['varetc_path']}/syslog.conf");
OpenPOWER on IntegriCloud