1822320 Members
5501 Online
109642 Solutions
New Discussion юеВ

rc code in cron log

 
SOLVED
Go to solution
Peggy Pyburn
Occasional Contributor

rc code in cron log

Does anyone know what the return code rc=255 means? I cannot find any documention on this particular code.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: rc code in cron log

Without being flippant it means what it means. That is simply the exit status of some job started by cron.

For example if the following were executed by cron,

#!/usr/bin/sh

typeset STAT=255
if [[ -f /etc/myfile ]]
then
STAT=0
fi
exit ${STAT}

it would produce rc=255 unless the file /etc/myfile were found.

In UNIX a zero status normally means ok but anything else means what the programmer/script writer intended for it to mean. By convention, the return result should try to match those in /usr/include/sys/errno.h but those only go so far.

You really have to find the script/program that is executing with the timestamp and then see what would cause it to exit with 255. This is not cron itself but rather what cron is executing.
If it ain't broke, I can fix that.
Rick Garland
Honored Contributor
Solution

Re: rc code in cron log

This post talks about cron error codes but does not list 255.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=86561

A guess, is the environment setup correctly? The cron has a very sparse environment. You must provide PATH to the commands in the cron.

What is it you were tyying to run via cron?




Peggy Pyburn
Occasional Contributor

Re: rc code in cron log

I am trying to run a query that's in our Informix database. For some reason this one will not execute.
Rick Garland
Honored Contributor

Re: rc code in cron log

In the crontab, are you specifying the full PATH to the command?

If so, then I agree with Clay, the command itself is producing the error.

Bill Hassell
Honored Contributor

Re: rc code in cron log

It means that the return code at the end of your job is 255. Most likely the command in cron works just fine if you run it from an ordinary login, and that's your problem. cron never logs in...it runs your command with a very minimal environment (ie, no Informix variables, paths, etc). So to run it in cron, you must explicitly set PATH (nver use the pre-supplied PATH) and all the Informix variables. So while this works logged in as informix:

onstat -o

in cron, you'll get: GLS initialization failed, error -23101

which means: Informix has no clue what instance you want or where the config files are located. You'll need to create an encapsulation witha shell script that matches your working login, then put the command inside the script.


Bill Hassell, sysadmin
Peggy Pyburn
Occasional Contributor

Re: rc code in cron log

I did get the command to execute. (There was a mistake in the path.) When I look at the cron log, however, there is not a second entry with the end time. The file has finished generating...does this mean I have a runaway process?

> CMD: /home/lcdhs/convert-script/convert00
> lcdhs 10035 c Fri Aug 19 14:35:00 PDT 2005