http://www.perlmonks.org?node_id=824028

aaron.m has asked for the wisdom of the Perl Monks concerning the following question:

I have a script with the following:
unlink("/ngvob/ui_rel/.emodel_is_running.flag"); $SIG{'CHLD'} = 'IGNORE';
This is on - don't laugh - Solaris 2.6 SPARC, running Perl 5.004_04. I can't change that; it's a legacy app that we still support.

This block is called when we're bringing down the entire system; the function is called Crash(), so we expect that things aren't working quite right, but not quite as bad as what we're seeing.

On certain occasions, the Perl script in charge of things craps the bed. The most recent example produced these messages in the log files:
Can't exec "/ngvob/ui_rel/.emodel_is_running.flag": Interrupted syst +em call at /path/to/myscript line 596 SIGCHLD handler "IGNORE" not defined.
Line 596 corresponds to the "unlink" line.

I don't really understand either of these messages. "Can't exec" looks like it's trying to execute the .emodel_is_running.flag file, instead of unlink() it. And how 'IGNORE' is not defined is puzzling.

Has anyone seen behavior like this, before?

Replies are listed 'Best First'.
Re: Unruly children...
by snoopy (Curate) on Feb 18, 2010 at 23:56 UTC
    Just a punt. Maybe a parent process, system shutdown or something else is sending signals that aren't being handled and are causing general havoc.

    One thing to try, if you're not already, is to trap and report on incoming signals, just to see what's going on.

    foreach (qw/HUP QUIT KILL TERM/) { my $msg = "slugged by a $_"; $SIG{$_} = sub {warn $msg}; }