Re: Can't cron a 4gl binary?????
Posted in 1992
In article <1992May21.125702.19695@magnus.acs.ohio-state.edu> mtrotter@magnus.acs.ohio-state.edu (Mark L Trotter) writes: >I am attempting to execute a compiled 4gl program (c compiler version) >from cron. I can run the prog from the command line ok, but every time >cron tries it, I get the message: > Please install an INFORMIX-4gl Run Time Facility and run this program again. >I don't understand why it won't run. Anyone got any ideas? I can't vouch for the meaning of the error message you describe above, but I suspect it might be related to the way cron works on some platforms. I initially had a lot of difficulty getting Informix programs running from cron because I didn't realize that the state of the Shell environment, when the job is run from cron, was different from that when I ran the job as myself or as root. On my particular platform, a Sequent Balance, it turns out that the only environment variables that are set, when a job is run via cron is "HOME". The point of all this is that when you go to run your 4GL program, there may not be appropriate PATH, INFORMIXDIR or DBPATH variables. If you want to test this, a simple means to finding out would be a small shell program like so run from cron: # !/bin/sh # If AT&T based system, substitute env for printenv. /usr/ucb/printenv > /tmp/env.for.cron Add a job to your crontab file to run this shell program, and then look at the contents of /tmp/env.for.cron. This will tell you how the environment looks when cron runs your jobs. Be sure to remove the job from your crontab file when you're through testing. If you discover that you are missing the important environment variables, such as INFORMIXDIR, write yourself a shell program wrapper to run your 4GL program, and have the shell program run out of cron instead of running the 4GL program directly. Within the shell program, define all of the missing environment variables required. Note: If the shell program is run as user root, be sure that ONLY root has read, write and execute permissions on this file. Remove these permissions from the group and others. -- +--------------------+-------------------------------------------------------+ | Michael Faurot | Domain: mfaurot@bogart.UUCP | | ------- ------ | UUCP: ...uunet!media!ka3ovk!irscscm!bogart!mfaurot | +--------------------+-------------------------------------------------------+