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


In reply to How to get a persistent daemons after exiting the session? by hackmare

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.