reload & log it
This commit is contained in:
parent
10bf45ee35
commit
f0272a12c3
1 changed files with 16 additions and 7 deletions
23
OTcerts.py
23
OTcerts.py
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue