Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: system() does not wait

by bluto (Curate)
on Nov 30, 2005 at 22:41 UTC ( #513133=note: print w/ replies, xml ) Need Help??


in reply to system() does not wait

Is script1 getting signaled (i.e. is the shell's value for ($? & 127) for script1 a non-zero value)? If so, what is the value? system() blocks SIGINT and SIGQUIT, but it's possible another signal is hitting it. I've seen wierd cases where a child spawned a vendor's utility that stupidly signaled the process group (e.g. something like SIGHUP). The child was ready and caught the signal, but the parent was blissfully ignorant of what signals might indirectly be thrown (and died). If this is the case, one way to get around this is to ignore the signal in the parent during the system() call...

{ local $SIG{'HUP'} = 'IGNORE'; # put your signal here system(...); }
You may get away with just ignoring all of the signals, but that depends on your code.


Comment on Re: system() does not wait
Download Code
Re^2: system() does not wait
by cbolcato (Novice) on Dec 01, 2005 at 13:39 UTC
    The following line of code were executed immediately after the system() and produced the out put below: #CODE $exit_value = $? >> 8; $signal_num = $? & 127; $dumped_core = $? & 128; print "$?\n"; print "$exit_value\n"; print "$signal_num\n"; print "$dumped_core\n";
      sorry the following is the output: #OUTPUT -1 16777215 127 128

        If $? is -1, then script2 is not getting invoked. How do you know that script2 is getting invoked at all? Is it doing something? Can you see it in a ps statement?

        Please print out an error message that contains the string-ified version of $! (That is, put something like print "$!" in your code).

        I strongly suspect that either you're forgetting to set your PATH variable or have forgotten to make SCRIPT2 executeable. Or maybe you typo'ed the name of SCRIPT2 in your system statement.

        Either way, the complete and total lack of markup in your responses makes it exceedingly difficult to read what you're trying to say.

        --
        @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513133]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-09-18 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (108 votes), past polls