Project

General

Profile

« Previous | Next » 

Revision 6f012614

Added by Pi Ba over 8 years ago

syslogd, create configured logsocket directories

(cherry picked from commit 4406922edb1000ef79f4fccfb484aa1103105ac0)

View differences:

src/etc/inc/system.inc
1069 1069
		}
1070 1070
		unset($syslogconf);
1071 1071

  
1072
		// Ensure that the log directory exists
1073
		if (!is_dir("{$g['dhcpd_chroot_path']}/var/run")) {
1074
			exec("/bin/mkdir -p {$g['dhcpd_chroot_path']}/var/run");
1075
		}
1076

  
1077 1072
		$sourceip = "";
1078 1073
		if (!empty($syslogcfg['sourceip'])) {
1079 1074
			if ($syslogcfg['ipproto'] == "ipv6") {
......
1100 1095
	if (isset($config['installedpackages']['package'])) {
1101 1096
		foreach ($config['installedpackages']['package'] as $package) {
1102 1097
			if (isset($package['logging']['logsocket']) && $package['logging']['logsocket'] != '' &&
1103
			    is_dir(dirname($package['logging']['logsocket'])) &&
1104 1098
			    !in_array($package['logging']['logsocket'], $log_sockets)) {
1105 1099
				$log_sockets[] = $package['logging']['logsocket'];
1106 1100
			}
1107 1101
		}
1108 1102
	}
1103
	
1109 1104
	$syslogd_sockets = "";
1110 1105
	foreach ($log_sockets as $log_socket) {
1106
		// Ensure that the log directory exists
1107
		$logpath = dirname($log_socket);
1108
		safe_mkdir($logpath);
1111 1109
		$syslogd_sockets .= " -l {$log_socket}";
1112 1110
	}
1113 1111

  

Also available in: Unified diff