Restarting a daemon

Discussion in 'Python' started by Jeffrey Barish, Apr 26, 2011.

  1. 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
    Jeffrey Barish, Apr 26, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. LJ
    Replies:
    0
    Views:
    1,095
  2. Mark Feather

    Problems after restarting IIS ????

    Mark Feather, Jul 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    447
    Mark Feather
    Jul 14, 2003
  3. Jean-Paul Calderone
    Replies:
    0
    Views:
    444
    Jean-Paul Calderone
    Mar 20, 2009
  4. Floris Bruynooghe
    Replies:
    1
    Views:
    439
    Floris Bruynooghe
    Mar 24, 2009
  5. Daemon Win32::Daemon;

    , Sep 7, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    237
Loading...

Share This Page