1833247 Members
2932 Online
110051 Solutions
New Discussion

Perl cron job ???

 
Philip Chan_1
Respected Contributor

Perl cron job ???

One of my perl cron job occasionally refused to start and the only clue that I could see was via elm for the following error,

"sh: 22329"

Does anyone know what does the above indicate?

Apparently the shell program aborted while trying to start my Perl program.

Any hints for my problem are welcome.

Thanks
Philip
9 REPLIES 9
Antoanetta Naghiu
Esteemed Contributor

Re: Perl cron job ???

Did you check the /var/adm/syslog/syslog.log to see what error is there?
Do you have set up the path in users profile or /etc/profile to your program?
While executing from the command prompt, is it coming with the same error?
What shell to you use?
Come back with details.
Antoanetta Naghiu
Esteemed Contributor

Re: Perl cron job ???

Try to trace it (set -o) and run it from command line....
Philip Chan_1
Respected Contributor

Re: Perl cron job ???

I actually cannot repeat the problem, because it only happened once every 2, 3 weeks out of ~300 runs. Every time I saw that error I also checked the syslog and no relating messages at all.

All paths seem to be correct.

The Perl script is indeed encapsulated by the korn shell such as,

10 10 * * * ksh "..."

but the standard output always said "sh: " instead, so I'm wondering if the problem occurred before it enters "ksh".

I also thought that this problem has nothing to do with the Perl script itself, but rather related to the environment or available system resource at that time. That is the reason why I'm interested to know what referring to.

Best regards,
Philip
Cheryl Griffin
Honored Contributor

Re: Perl cron job ???

Be sure to check the /var/adm/cron/log to see if there is any additional information that may be of assistance.
"Downtime is a Crime."
Antoanetta Naghiu
Esteemed Contributor

Re: Perl cron job ???

Are well patched regarding shells?
I had some no-all-the-time error because of missing patches....(eg: in HP-UX 11.0 PHCO_13363).
I have no other better idea...
curt larson
Frequent Advisor

Re: Perl cron job ???

the refers the process id of the shell.

look in the /var/adm/cron/log for that process number
there might be a return code associated with it
a " rc= "
This could help point you to the reason the shell exited.
nobody else has this problem
Jim Welch
Respected Contributor

Re: Perl cron job ???

You could also add some debugging to the process. If cron kicks of a one line command that starts the ksh and perl, you could instead call a shell script that
does some logging prior to calling the perl script (date, time, pid, some text to indicate that the script is running), then do the same in the perl script and in the ksh script after the perl script terminates. You can scan through the log file and see if there are any indications of where the failure occured. If nothing is logged for a particular day, it could indicate that the shell script failed to initialize. If you were running out of file handles or the process table was full, I would have expected to see some indication in syslog.log unless you have the logging level turned down. If you have MeasureWare, you can check some of the kernel table values and see how busy the system was at the time the problem occured.
Any sufficiently advanced technology is indistinguishable from Magic - Arthur C. Clarke

Re: Perl cron job ???

Hi philip,

Have u tried putting -x option after ksh , which will let you know the status of the execution of the each command.

I suppose the number should be an error no. due to some failed system call.

REgs,
S.J.Babu
Today is the day
Philip Chan_1
Respected Contributor

Re: Perl cron job ???

Guys, thanks for all your helps so far. Frankly speaking I'll be tied up by some other tasks in the next few weeks therefore may not have the time to explode further on this problem, but as soon as I free up then I'll trace on this again with all your suggestions.

Cheers
Philip.