Commit efda2243 authored by Till Brehm's avatar Till Brehm
Browse files

Fixed ISPConfig server log warning: Unable to add a delayed restart for...

Fixed ISPConfig server log warning:  Unable to add a delayed restart for 'postfix'. Service not registered.
parent 724b7e4f
......@@ -113,6 +113,7 @@ class mail_module {
$app->modules->registerTableHook('spamfilter_wblist', 'mail_module', 'process');
$app->services->registerService('rspamd', 'mail_module', 'restartRspamd');
$app->services->registerService('postfix', 'mail_module', 'restartPostfix');
}
/*
......@@ -192,6 +193,22 @@ class mail_module {
}
return $retval;
}
function restartPostfix($action = 'reload') {
global $app;
$app->uses('system');
$daemon = 'postfix';
$retval = array('output' => '', 'retval' => 0);
if($action == 'restart') {
exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
} else {
exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
}
return $retval;
}
} // end class
?>
Markdown is supported
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