Monks:

I'm trying to write a kick-off script for a program. I'll be sticking it in my crontab, but from time to time, I'll have to restart it manually, presumably from just copying from the crontab. What's worse, is that otherp eople will be doing the same thing, so I need to make it rather friendly.

I want the users to just run the script with it's arguments, and have them returned back to the prompt .I figured it would be easier to just have exec run the program, sending it to nohup. That works fine, but I do not get my prompt back, even if I run something like
exec("nohup", "/path/to/prog", "args", "&")
In fact, it seems that it passes & as an argument, as I can see it when I grep out the process.

Conversely, running the script with an ampersand appended doesn't give me my prompt back either.

Reading up, I see that exec replaces the currently running perl with whatever program exec kicks off. That's all fine and dandy, but I don't know what it means for me in the long run.

Thanks

In reply to Starting a process and dying... by GaijinPunch

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.