Commit e3cd8bfb authored by Marius Burkard's avatar Marius Burkard
Browse files

- fixed --no-dns still setting local resolver and installing bind9, fixes #19

parent 46184687
...@@ -119,10 +119,13 @@ class ISPConfigDebianOS extends ISPConfigBaseOS { ...@@ -119,10 +119,13 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
'zip', 'zip',
'libnet-dns-perl', 'libnet-dns-perl',
'libdbd-mysql-perl', 'libdbd-mysql-perl',
'bind9',
'dnsutils' 'dnsutils'
); );
if(ISPConfig::shallInstall('dns')) {
$packages[] = 'bind9';
}
if(ISPConfig::shallInstall('mail')) { if(ISPConfig::shallInstall('mail')) {
$packages[] = 'spamassassin'; $packages[] = 'spamassassin';
if(ISPConfig::wantsAmavis()) { if(ISPConfig::wantsAmavis()) {
...@@ -704,23 +707,26 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; ...@@ -704,23 +707,26 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
} }
$this->restartService('unbound'); $this->restartService('unbound');
*/ */
if(!is_dir('/etc/resolvconf/resolv.conf.d')) {
mkdir('/etc/resolvconf/resolv.conf.d', 0755);
}
$this->addLines('/etc/resolvconf/resolv.conf.d/head', 'nameserver 127.0.0.1', false);
$cmd = 'resolvconf -u 2>&1';
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
ISPConfigLog::info('Checking local dns resolver.', true); if(ISPConfig::shallInstall('dns')) {
$cmd = 'nslookup denic.de | grep Server'; if(!is_dir('/etc/resolvconf/resolv.conf.d')) {
$result = $this->exec($cmd); mkdir('/etc/resolvconf/resolv.conf.d', 0755);
if($result === false) { }
throw new ISPConfigOSException('Command ' . $cmd . ' failed.'); $this->addLines('/etc/resolvconf/resolv.conf.d/head', 'nameserver 127.0.0.1', false);
} elseif(strpos($result, '127.0.0.1') === false) { $cmd = 'resolvconf -u 2>&1';
ISPConfigLog::warn('Unexpected resolver response: ' . $result, true); $result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
}
ISPConfigLog::info('Checking local dns resolver.', true);
$cmd = 'nslookup denic.de | grep Server';
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
} elseif(strpos($result, '127.0.0.1') === false) {
ISPConfigLog::warn('Unexpected resolver response: ' . $result, true);
}
} }
if(ISPConfig::shallInstall('web')) { if(ISPConfig::shallInstall('web')) {
...@@ -1191,8 +1197,11 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; ...@@ -1191,8 +1197,11 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
'mysql', 'mysql',
'clamav-daemon', 'clamav-daemon',
'postfix', 'postfix',
'bind9',
); );
if(ISPConfig::shallInstall('dns')) {
$check_services[] = 'bind9';
}
if(ISPConfig::shallInstall('web')) { if(ISPConfig::shallInstall('web')) {
$check_services[] = 'pureftpd'; $check_services[] = 'pureftpd';
if(ISPConfig::$WEBSERVER === ISPC_WEBSERVER_APACHE) { if(ISPConfig::$WEBSERVER === ISPC_WEBSERVER_APACHE) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment