Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-25 15:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found