Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Restarting a daemon

Reply
Thread Tools

Restarting a daemon

 
 
Jeffrey Barish
Guest
Posts: n/a
 
      04-26-2011
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Floris Bruynooghe Python 1 03-24-2009 02:58 PM
Re: PEP 3143: Standard daemon process library (was: Writing awell-behaved daemon) Jean-Paul Calderone Python 0 03-20-2009 01:02 PM
Daemon Win32::Daemon; ph1975@gmail.com Perl Misc 0 09-07-2006 10:58 AM
computer keep restarting. =?Utf-8?B?ZGV3YQ==?= Wireless Networking 2 03-13-2005 01:01 AM
Restarting the tray icon James Messick Firefox 6 11-15-2003 01:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57