reload & log it

This commit is contained in:
jigen 2020-02-24 00:37:49 +01:00
parent 10bf45ee35
commit f0272a12c3

View file

@ -319,12 +319,21 @@ if __name__ == '__main__':
logger.error('Error asking certificate for {}'.format(vhost_name))
if set('webmail','hosting','liste') & set(service_reload.keys()):
if set(['webmail','hosting','liste']) & set(service_reload.keys()):
# reload apache
ret = subprocess.run("systemctl reload apache2")
if set('smtp',) & set(service_reload.keys()):
logger.info("Restarting apache")
# ret = subprocess.run("systemctl reload apache2")
ret = os.system("systemctl reload apache2")
logger.info(ret)
if set(['smtp',]) & set(service_reload.keys()):
# reload postfix
ret = subprocess.run("systemctl reload postfix")
if set('mbox',) & set(service_reload.keys()):
# reload dovecot
ret = subprocess.run("systemctl reload dovecot")
logger.info("Restarting postfix")
# ret = subprocess.run("systemctl reload postfix")
ret = os.system("systemctl reload postfix")
logger.info(ret)
if set(['mbox',]) & set(service_reload.keys()):
# restart dovecot
logger.info("Restarting dovecot")
# ret = subprocess.run("systemctl restart dovecot")
ret = os.system("systemctl reload dovecot")
logger.info(ret)