Gunicorn :: reboot from the application itself

I recently created a version control page from my deployment management application.

(Yes, I know github + hooks are better than rewriting from scratch. But we are in Iran and our beloved government has blocked all ssh connections outside the country .: (()

The page has a merge action + reload. merging works like other parts, but part of the reboot fails without any message. I added the sudo line for the kill command, and the workflow user has sufficient permission. I even executed the django shell code form and reloaded the process.

Is there any restriction on receiving signals, such as workers, who cannot restart their master?

Here are the relevant codes:

def command(x): return str(Popen(x.split(' '), stdout=PIPE).communicate()[0]) pid = open(PATH + "/logs/gunicorn.pid").readline().strip() cmd = "sudo kill -HUP %s" % pid content += command(cmd) 
+7
source share
1 answer

Guess that the reboot does not work because the process causing the reboot is being killed. Perhaps try dismantling the subprocess that exits after the reboot call? Take a look at this post:

spawning process from python

+1
source

All Articles