From cac8c354ae00dcb2fcc4747ea65e7280f8e73257 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 29 Nov 2018 19:14:42 +0100 Subject: [PATCH] Created /run/uwsgi folder if not present on CentOS. see #248 --- modoboa_installer/scripts/uwsgi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modoboa_installer/scripts/uwsgi.py b/modoboa_installer/scripts/uwsgi.py index 48ab43b..8fcbdbf 100644 --- a/modoboa_installer/scripts/uwsgi.py +++ b/modoboa_installer/scripts/uwsgi.py @@ -1,6 +1,8 @@ """uWSGI related tools.""" import os +import pwd +import stat from .. import package from .. import system @@ -97,6 +99,15 @@ class Uwsgi(base.Installer): def restart_daemon(self): """Restart daemon process.""" + # Temp. fix for CentOS + if utils.dist_name().startswith("centos"): + pw = pwd.getpwnam("uwsgi") + utils.mkdir( + "/run/uwsgi", + stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | + stat.S_IROTH | stat.S_IXOTH, + pw[2], pw[3] + ) code, output = utils.exec_cmd("service uwsgi status") action = "start" if code else "restart" utils.exec_cmd("service uwsgi {}".format(action))