@@ -5,6 +5,7 @@ import pwd
|
||||
|
||||
from .. import database
|
||||
from .. import package
|
||||
from .. import system
|
||||
from .. import utils
|
||||
|
||||
from . import base
|
||||
@@ -102,5 +103,6 @@ class Dovecot(base.Installer):
|
||||
code, output = utils.exec_cmd("service dovecot status")
|
||||
action = "start" if code else "restart"
|
||||
utils.exec_cmd(
|
||||
"service dovecot {} > /dev/null 2>&1".format(action),
|
||||
"service {} {} > /dev/null 2>&1".format(self.appname, action),
|
||||
capture_output=False)
|
||||
system.enable_service(self.get_daemon_name())
|
||||
|
||||
@@ -97,11 +97,7 @@ class Uwsgi(base.Installer):
|
||||
|
||||
def restart_daemon(self):
|
||||
"""Restart daemon process."""
|
||||
instances = ["modoboa_instance"]
|
||||
if self.config.getboolean("automx", "enabled"):
|
||||
instances.append("automx_instance")
|
||||
for instance in instances:
|
||||
code, output = utils.exec_cmd("service uwsgi status {}".format(
|
||||
instance))
|
||||
action = "start" if code else "restart"
|
||||
utils.exec_cmd("service uwsgi {}".format(action))
|
||||
code, output = utils.exec_cmd("service uwsgi status")
|
||||
action = "start" if code else "restart"
|
||||
utils.exec_cmd("service uwsgi {}".format(action))
|
||||
system.enable_service(self.get_daemon_name())
|
||||
|
||||
Reference in New Issue
Block a user