Created /run/uwsgi folder if not present on CentOS.

see #248
This commit is contained in:
Antoine Nguyen
2018-11-29 19:14:42 +01:00
parent 31d0e9b9f0
commit cac8c354ae

View File

@@ -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))