Menu

#3 Redhat 9 and swatch

open
None
5
2004-05-06
2003-07-15
No

Running swatch on Redhat 9, the following appears in
/var/log/messages when starting swatch:

kernel: application bug: perl(12110) has SIGCHLD set to
SIG_IGN but calls wait().
kernel: (see the NOTES section of 'man 2 wait').
Workaround activated.

The referenced section of the man page indicates:

The Single Unix Specification describes a flag
SA_NOCLDWAIT (not supported under Linux) such that if
either this flag is set, or the action for SIGCHLD is
set to SIG_IGN then children that exit do not
become zombies and a call to wait() or waitpid() will
block until all children have exited, and then fail
with errno set to ECHILD.

The original POSIX standard left the behaviour of
setting SIGCHLD to SIG_IGN unspecified. Later
standards, including SUSv2 and POSIX 1003.1-2001
specify the behaviour just described as an
XSI-compliance option. Linux does not conform to
the second of the two points just described: if a
wait() or waitpid() call is made while SIGCHLD is being
ignored, the call behaves just as though SIGCHLD were
not being igored, that is, the call blocks until the
next child terminates and then returns the PID and
status of that child.

Discussion

  • Anonymous

    Anonymous - 2003-07-15

    Logged In: YES
    user_id=229214

    The solution (see
    http://www.perl.com/pub/a/2003/01/07/mod_perl.html\) appears
    to be removing the waitpid in exec_command:

    #
    # exec_command(args) -- fork and execute a command
    #
    sub exec_command {
    my %args = (@_);
    my $exec_pid;
    my $command;

    if (exists $args{'COMMAND'}) {
    $command = $args{'COMMAND'};
    } else {
    warn "$0: No command was specified in exec action.\n";
    return;
    }

    return if exists($args{'WHEN'}) and not
    inside_time_window($args{'WHEN'});

    EXECFORK: {
    if ($exec_pid = fork) {
    # Mace Moneta 07/15/2003, remove waitpid on RH9
    # waitpid(-1, WNOHANG);
    return;
    } elsif (defined $exec_pid) {
    exec($command);
    } elsif ($! =~ /No more processes/) {
    # EAGAIN, supposedly recoverable fork error
    sleep 5;
    redo EXECFORK;
    } else {
    warn "$0: Can't fork to exec $command: $!\n";
    }
    }
    return;
    }

     
  • Todd Atkins

    Todd Atkins - 2004-05-06
    • assigned_to: nobody --> toddatkins
     

Log in to post a comment.

Monday.com Logo