@@ -1,6 +1,8 @@
|
|||||||
"""uWSGI related tools."""
|
"""uWSGI related tools."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import pwd
|
||||||
|
import stat
|
||||||
|
|
||||||
from .. import package
|
from .. import package
|
||||||
from .. import system
|
from .. import system
|
||||||
@@ -97,6 +99,15 @@ class Uwsgi(base.Installer):
|
|||||||
|
|
||||||
def restart_daemon(self):
|
def restart_daemon(self):
|
||||||
"""Restart daemon process."""
|
"""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")
|
code, output = utils.exec_cmd("service uwsgi status")
|
||||||
action = "start" if code else "restart"
|
action = "start" if code else "restart"
|
||||||
utils.exec_cmd("service uwsgi {}".format(action))
|
utils.exec_cmd("service uwsgi {}".format(action))
|
||||||
|
|||||||
Reference in New Issue
Block a user