From 33bcd0069e1c051def4253bd310eac619405b929 Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Mon, 21 Oct 2013 05:41:19 -0400
Subject: [PATCH] - Added support for systemd and upstart (besides sysvinit).
---
server/mods-available/dns_module.inc.php | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/server/mods-available/dns_module.inc.php b/server/mods-available/dns_module.inc.php
index 2a06361..9bab96e 100644
--- a/server/mods-available/dns_module.inc.php
+++ b/server/mods-available/dns_module.inc.php
@@ -121,6 +121,8 @@
function restartBind($action = 'restart') {
global $app,$conf;
+ $app->uses('system');
+
$daemon = '';
if(is_file($conf['init_scripts'] . '/' . 'bind9')) {
$daemon = 'bind9';
@@ -130,9 +132,9 @@
$retval = array('output' => '', 'retval' => 0);
if($action == 'restart') {
- exec($conf['init_scripts'] . '/' . $daemon . ' restart 2>&1', $retval['output'], $retval['retval']);
+ exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
} else {
- exec($conf['init_scripts'] . '/' . $daemon . ' reload 2>&1', $retval['output'], $retval['retval']);
+ exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
}
return $retval;
}
@@ -140,6 +142,7 @@
function restartPowerDNS($action = 'restart') {
global $app,$conf;
+ $app->uses('system');
$app->log("restartPDNS called.",LOGLEVEL_DEBUG);
/** Since PowerDNS does not currently allow to limit AXFR for specific zones to specific
@@ -179,7 +182,7 @@
}
$retval = array('output' => '', 'retval' => 0);
- exec($conf['init_scripts'] . '/' . $daemon . ' restart 2>&1', $retval['output'], $retval['retval']);
+ exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
// unset $tmps;
return $retval;
--
Gitblit v1.9.1