Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hrm - I'm working on getting a site update site (kinda meta, eh?) up. the basic update code utilizes lynx to check the sites for updates and writes to a flat text file.

I'm using cron to run the script once an hour. Even though there are no errors when running the update script from the console, I have no problem, I get the following email sent to me once an hour...

From: root (Cron Daemon)
To: watch
Subject: Cron <watch@stanthony> /home/watch/www/update.pl
Can't ignore signal CHLD, forcing to default.

anyone know of any issues between cron and perl, or utilizing lynx? 's all very odd.

Replies are listed 'Best First'.
Re: cron/perl?
by arturo (Vicar) on Nov 27, 2000 at 00:57 UTC

    Cut 'n paste from perlman:perldiag (consult your own system's documentation with perldoc perldiag or place use diagnostics at the top of your script for a more definitive answer)

    Can't ignore signal CHLD, forcing to default
    (W signal) Perl has detected that it is being run with the SIGCHLD signal (sometimes known as SIGCLD) disabled. Since disabling this signal will interfere with proper determination of exit status of child processes, Perl has reset the signal to its default value. This situation typically indicates that the parent program under which Perl may be running (e.g. cron) is being very careless.

    So, I suppose, in a way, the answer is "yes, there are sometimes issues between cron and perl," and you seem to have run across one of them.

    How to fix it? One way is to make it explicit at the beginning of your script, using the special block BEGIN:

    #!/usr/bin/perl -w use strict; BEGIN { SIG{CHLD} = 'DEFAULT'; }
    Which will suppress the error message, at least. (well, disabling -w will do that too =)

    As an aside, I'd suggest going all-perl with this project,

    • fetch the pages with LWP::Simple
    • print fetched page to a file
    • compare the new file to one you've created earlier using this same process
    • you can use File::Compare for the file comparison
    HTH

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: cron/perl?
by the_slycer (Chaplain) on Nov 27, 2000 at 00:47 UTC
    All I can tell you is that it's probably not lynx. I've made use of lynx in perl scripts running from cron with no issues.