Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Exec() and getting system PID

by hossman (Prior)
on Jan 14, 2002 at 12:09 UTC ( [id://138539] : note . print w/replies, xml ) Need Help??


in reply to Exec() and getting system PID

Is this the program you are using?

If so, are you sure you aren't using the "-f|-fork" option?

My guess is, you should use my $pidline = `root-tail -f ...` but for some reason, root-tail v0.0.10 has the line for printing the PID commented out...

pid = fork (); if (pid != 0) { /*printf ("forking mode: pid=%d\n", pid);*/ exit (0); }
(You may want to mail the devloper and ask what gives.)

However, if you don't use -f, the code you have above seems to work just fine.