unbound: set up a full chroot including local log socket #2791

This commit is contained in:
Franco Fichtner 2018-10-17 17:23:45 +00:00
parent e720c570d9
commit 2d5d392bc2
2 changed files with 13 additions and 1 deletions

View File

@ -418,6 +418,18 @@ function unbound_configure_do($verbose = false, $interface = '')
return;
}
$dirs = array('/dev', '/etc', '/lib', '/run', '/usr', '/usr/local/sbin', '/var/db', '/var/run');
foreach ($dirs as $dir) {
mwexecf('/bin/mkdir -p %s', "/var/unbound{$dir}");
}
if (mwexecf('/sbin/mount -uw %s', '/var/unbound/dev', true)) {
mwexecf('/sbin/mount -t devfs devfs %s', '/var/unbound/dev');
}
mwexecf('/usr/sbin/chown -R unbound:unbound %s', '/var/unbound');
if ($verbose) {
echo 'Starting Unbound DNS...';
flush();

View File

@ -693,7 +693,7 @@ function system_syslogd_start($verbose = false, $restart = false)
$syslogconfs['pkg'] = array('facility' => array('pkg', 'pkg-static'));
$syslogconfs['portalauth'] = array('facility' => array('captiveportal'), 'remote' => 'portalauth');
$syslogconfs['ppps'] = array('facility' => array('ppp'));
$syslogconfs['resolver'] = array('facility' => array('unbound'), 'remote' => 'dns');
$syslogconfs['resolver'] = array('facility' => array('unbound'), 'local' => '/var/unbound/var/run/log', 'remote' => 'dns');
$syslogconfs['routing'] = array('facility' => array('radvd', 'routed', 'rtsold', 'olsrd', 'zebra', 'ospfd', 'bgpd', 'miniupnpd'));
$syslogconfs['wireless'] = array('facility' => array('hostapd'), 'remote' => 'hostapd');