Skip to content

Commit efda224

Browse files
author
Till Brehm
committed
Fixed ISPConfig server log warning: Unable to add a delayed restart for 'postfix'. Service not registered.
1 parent 724b7e4 commit efda224

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

server/mods-available/mail_module.inc.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class that contains the function functionname.
113113
$app->modules->registerTableHook('spamfilter_wblist', 'mail_module', 'process');
114114

115115
$app->services->registerService('rspamd', 'mail_module', 'restartRspamd');
116+
$app->services->registerService('postfix', 'mail_module', 'restartPostfix');
116117
}
117118

118119
/*
@@ -192,6 +193,22 @@ function restartRspamd($action = 'reload') {
192193
}
193194
return $retval;
194195
}
196+
197+
function restartPostfix($action = 'reload') {
198+
global $app;
199+
200+
$app->uses('system');
201+
202+
$daemon = 'postfix';
203+
204+
$retval = array('output' => '', 'retval' => 0);
205+
if($action == 'restart') {
206+
exec($app->system->getinitcommand($daemon, 'restart').' 2>&1', $retval['output'], $retval['retval']);
207+
} else {
208+
exec($app->system->getinitcommand($daemon, 'reload').' 2>&1', $retval['output'], $retval['retval']);
209+
}
210+
return $retval;
211+
}
195212
} // end class
196213

197214
?>

0 commit comments

Comments
 (0)