It sounds to me like you're trying to do things with this program that it was fundamentally not designed to do. You want to control its processes manually from the outside, but it was clearly designed to handle them automatically internally. You want to separately manage multiple instances of it, but if it's an even vaguely typical Unix daemon (other than getty) it's probably either designed to only ever have one instance, or else to fork (or even prefork) as many processes as it needs automatically.

Perl and daemons are widely used, I don't believe that no one worked on this problem.

I think everything is working exactly as it was designed to work, but you're trying to change the design for how the program (the daemon) is supposed to work, and you want to do that without changing the program itself. Good luck with that.

-- 
We're working on a six-year set of freely redistributable Vacation Bible School materials.

In reply to Re: Fork daemon from Perl script and save it's PID. How to do it right? by jonadab
in thread Fork daemon from Perl script and save it's PID. How to do it right? by accessdenied

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.