I believe I have an answer to this now ...  

In talking with a local perl programmer, he mentioned the Daemon modules
on CPAN.  I did some research and it looks like I can use the
Proc::Daemon module to do exactly what I want.  Basically, it forks
itself immediately and "detaches" itself from the main program...  So,
if I call this with system(), the call returns immediately...

I still have no "easy" way to return the PID of this new process, so I'm
going to resort to a directory full of .pid files ...  That, at least,
will get me to the point where I can start working on this!

Any comments/suggestions regarding this are greatly appreciated!

Friz

On Tue, 2002-11-19 at 09:11, Jason Frisvold wrote:
> But, if I go the way of the fork, the program cannot be broken down into
> lots of mini-programs which are designed to do a single job.. everything
> would have to be rolled into one larger program with (I'm guessing here)
> multiple fork points to handle each different type of system I'm trying
> to run ...
> 
> I *think* I can do it with a wrapper program that launches the new
> program and reports back the pid, but that doesn't seem right to me ... 
> It seems that this is something that Perl should be able to do, but I
> can't figure out how to do it ...
> 
> How about an example ...  The main program is called monitor.perl ... 
> While it's running, it spawns a second program called pingit.perl and a
> third called snmpit.perl ...  I want both pingit and snmpit to be able
> to run concurrently while monitor watches to ensure that those programs
> don't run too long, don't report back errors, and does some calculations
> to ensure that it's running efficiently...
> 
> How do I allow monitor.perl to spawn pingit.perl and snmpit.perl and
> still continue running itself?
> 
> -- 
> ---------------------------
> Jason H. Frisvold
> Senior ATM Engineer
> Penteledata Engineering
> [EMAIL PROTECTED]
> RedHat Certified - RHCE # 807302349405893
> ---------------------------
> "Something mysterious is formed, born in the silent void. Waiting alone
> and unmoving, it is at once still and yet in constant motion. It is the
> source of all programs. I do not know its name, so I will call it the
> Tao of Programming."

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to