From 42ee8bde8b3eaf041a8c3303c4bc71f612e25a53 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 18 Dec 2010 14:57:42 -0500 Subject: Ensure log directory exists before invoking syslogd --- etc/inc/services.inc | 1 - etc/inc/system.inc | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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"); -- cgit v1.1