in reply to Re^3: run a background process
in thread run a background process

The thing is: I run a mud, and lately the server has been rebooting every few days. The server admin won't add my mud to the crontab or something to make it start along with the server, so I devised this, to allow any of my players to startup the mud in these cases.

Now a single click can launch the game. Of course, it will check whether the game is already running (and some other things) to prevent abuse.

Replies are listed 'Best First'.
Re^5: run a background process
by blazar (Canon) on Jul 15, 2005 at 07:47 UTC
    Then I don't see why a classic fork+exec shouldn't do it and I guess I can't be of more help to you than this, sorry...
      It's ok, problem solved. I just needed to close stdin and stdout for the cgi stuff to end.

      And had to use 'setsid' or the program dies whenever the web server goes down.