http://www.perlmonks.org?node_id=241875

hackmare has asked for the wisdom of the Perl Monks concerning the following question:

HI Monks,

I am in the process of building a daemonized webservice and am looking for a good way to turn it on/off.

What I'd really like to do is something like what apache does where you can call:
httpd start
httpd stop
httpd restart

I've seen shell scripts used to do something like this and would be a lot happier doing it in Perl, but there's still one nagging problem: I need to jeep the job running even if I kill my session.

I can not find any way to do this other than through the use of nohup on the linux/unix. The trouble is that when I use nohup, I get issues in some of the instantiations within my script (it has an HTTP::Daemon listener which takes up to 30 seconds to reply under nohup for a reason I have not yet understood).

So my questions are the following:

1/ Is the a pure-perl replacement for nohup that would allow me to start a perl daemon and then keep it running even if I close my session?

2/ Other than using something like semaphores or equivalent, can anyone think of a cute way to do 1/ above and restart the script by calling it?

Thanks for putting up with this ignorance,

Hackmare

Roasp: Perl SVG Portal