Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4034

Restarting a daemon

From Jeffrey Barish <jeff_barish@earthlink.net>
Subject Restarting a daemon
Followup-To gmane.comp.python.general
Date 2011-04-26 06:13 -0600
Newsgroups comp.lang.python
Message-ID <mailman.835.1303820019.9059.python-list@python.org> (permalink)

Followups directed to: gmane.comp.python.general

Show all headers | View raw


Not exactly a Python question, but I thought I would start here.

I have a server that runs as a daemon.  I can restart the server manually 
with the command 

myserver restart

This command starts a new myserver which first looks up the pid for the one 
that is running and sends it a terminate signal.  The new one then 
daemonizes itself.

I want the server to be able to restart itself.  Will it work to have 
myserver issue "myserver restart" using os.system?  I fear that the new 
myserver, which will be running in a subshell, will terminate the subshell 
along with the old myserver when it sends the terminate signal to the old 
myserver.  If so, what is the correct way to restart the daemon?  Will it 
work to run the restart command in a subprocess rather than a subshell or 
will a subprocess also terminate when its parent terminates?
-- 
Jeffrey Barish

Back to comp.lang.python | Previous | Next | Find similar


Thread

Restarting a daemon Jeffrey Barish <jeff_barish@earthlink.net> - 2011-04-26 06:13 -0600

csiph-web