zentara <[EMAIL PROTECTED]> writes: > On Tue, 02 Mar 2004 18:07:58 -0600, [EMAIL PROTECTED] (Harry Putnam) > wrote: >> >>For some reason the pid printed does not match the output of ps: >> >>actual sample script" >> >>Note the script outputs 15173 and ps shows 30335 >> >>Do you have an idea what is happening here? > > Yeah, you are getting the parent pid in the perl script. > When you try to use system or exec to start another > process, perl gets the pid of the very first part of the whole > transaction, which is usually the pid of the xterm or the > bash shell which will run your command with a second pid. > It usually works ok, because when you kill the parent pid, > it's children get killed too, so we hardly ever have to deal > with them being different.
If you want to log it for SIGHUP in /var/run/process.pid would the parent work as well? > Use Proc::ProcessTable to get the pid of your program name. > Here is an example: ---8<snip script Not sure I understand what I'm supposed to be seeing. None of this output resembles a pid. I shortened the count up to 10 and watched it output to STDOUT and to a separate tty... output STDOUT 1 2 3 [...] other TTY 1a 2a 3a [...]' NOt sure I get what this has to do with two pids involved. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>