cron and setting TERM
Posted in 1999
After upgrading SCO OpenServer 5.0.2 to 5.0.5a, the poster's Informix 4GL/RDS 7.20 programs launched via cron (fglgo) died with error -1170, "terminal type unknown", even though the same script ran fine interactively and other cron jobs using dbaccess worked. Suggestions included explicitly exporting TERM and TERMCAP (and INFORMIXTERM), checking the termcap file path and its permissions for the cron user, and finally a theory that 4GL OPTIONS statements do terminal ioctls and should be skipped when running detached. The poster never confirmed a fix, so no resolution is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Installation, Setup & Upgrades, Server Administration
I have recently upgraded a system from SCO Openserver 5.0.2 to
5.0.5a and am having a large problem with cron running Informix RDS
7.20 programs.
Regardless of the environment in which I run my cron jobs, my RDS
programs report; error -1170, Terminal is unknown to the system.
Now I've tried everything I can think of to get these beasties to run.
I've set TERM and TERMCAP at various places around the script that
cron is running, and echo'ed it back to log files for checking. No
luck, but no question that all of the environment is set correctly
before the final fglgo which runs the program.
I've unset every env variable at the command line and run the script
[manually] and it works OK. The machine which we have migrated from
still has the DB, programs and scripts on it, and these run fine,
and in fact have done for a few years through many versions of RDS.
Needless to say the Informix versions are identical between machines.
This is a little scary as it would seem to be a SCO problem until you
consider that all other cron jobs (not involving Informix RDS) run
fine, including some that use other Informix elements such as dbaccess.
I'm at a complete loss. Thanks in advance.
Bryan Tonnet
batonnet@phase4.com.au
On Mon, 23 Aug 1999 21:00:26 +1000, Bryan Tonnet <batonnet@phase4.com.au>
wrote:
>I have recently upgraded a system from SCO Openserver 5.0.2 to
>5.0.5a and am having a large problem with cron running Informix RDS
>7.20 programs.
>
>Regardless of the environment in which I run my cron jobs, my RDS
>programs report; error -1170, Terminal is unknown to the system.
>This is a little scary as it would seem to be a SCO problem until you
>consider that all other cron jobs (not involving Informix RDS) run
>fine, including some that use other Informix elements such as dbaccess.
>
I don't think this is a SCO problem. You need to provide your script to
see what's going on. I run Informix 7.3 from cron and it works fine. Also
provide an 'env' where the Informix does work. Also, put an 'env' in your
cron script and output the results to a file.
Gary Quiring
On Mon, 23 Aug 1999 13:42:19 GMT, in article
<37c149ca.3564792@news.netlabs.net>, garyq@emcosales.com (Gary Quiring) wrote:
>On Mon, 23 Aug 1999 21:00:26 +1000, Bryan Tonnet <batonnet@phase4.com.au>
>wrote:
>
>>I have recently upgraded a system from SCO Openserver 5.0.2 to
>>5.0.5a and am having a large problem with cron running Informix RDS
>>7.20 programs.
>>
>>Regardless of the environment in which I run my cron jobs, my RDS
>>programs report; error -1170, Terminal is unknown to the system.
>
>>This is a little scary as it would seem to be a SCO problem until you
>>consider that all other cron jobs (not involving Informix RDS) run
>>fine, including some that use other Informix elements such as dbaccess.
>>
>
>I don't think this is a SCO problem. You need to provide your script to
>see what's going on. I run Informix 7.3 from cron and it works fine. Also
>provide an 'env' where the Informix does work. Also, put an 'env' in your
>cron script and output the results to a file.
It's sort of both. He needs to put TERM=vt100 ; export TERM in the script
running from cron or he needs to . a .profile with the value in it. SCO
doesn't assume a TERM type and Informix needs it.
BTW, TERM= doesn't have to be vt100, it DOES have to exist in Informix's
TERMCAP or in terminfo.
If the TERM variable IS set, and it still doens't work. Add a
TERMCAP=/path/to/termcap ; export TERMCAP as well.
--
for i in databasix.com ntrnet.net primenet.com ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DOH! | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
PGP Public Key: http://www.databasix.com/~gburnore/pubkey/pubkey.html
===========================================================================
Thanks to those that have responded with suggestions via mail or here.
No solution to date, but below is more detail for those that are
curious.
Gary Quiring wrote:
> I don't think this is a SCO problem. You need to provide your script to
> see what's going on. I run Informix 7.3 from cron and it works fine. Also
> provide an 'env' where the Informix does work. Also, put an 'env' in your
> cron script and output the results to a file.
I'm sure I've covered all the env bases, but just to highlight, here's
a trimmed script that runs from a command line, but not from cron.
---------
#!/bin/sh
# Setup standard environment
TERM=wy60 export TERM
TERMCAP=/app2/pmsinf/termcap export TERMCAP
INFORMIXDIR=/app1/informix7 export INFORMIXDIR
INFORMIXSERVER=ranger_pd export INFORMIXSERVERDBCENTURY=C export DBCENTURY
DBPATH=/app1/pmsinf/dbs:/app2/pmsinf/runtime/lib export DBPATHDBEDIT=vi export DBEDIT
DBDATE=DMY2/ export DBDATEDBTEMP=/tmp export DBTEMP
PATH=/app2/pmsinf/scripts:$INFORMIXDIR/bin:$PATH export PATH
LPPICK=2391b export LPPICK
DEFWARE="NS" export DEFWARE
# Run this
cd /app2/pmsinf/runtime/programs/pickprint
fglgo pickprint NS % \\"\\" 2391b X 1 D
--------
At the command line, I unset every environment variable before
running it, and it does its thang successfully.
From cron, I get the following [Informix RDS] error.
Program stopped at "pickprint.4gl", line number 140.
FORMS statement error number -1170.
The type of your terminal is unknown to the system.
echo'ing $TERM/$TERMCAP just before fglgo verifies these two variables
are set correctly. Shelling down at this point (to check the export)
also verifies that TERM/TERMCAP are still OK.
Line 140 is just inside the MAIN clause and is nothing in particular.
If I remove the line, it simply fails somewhere else just
inside the start of MAIN. fglgo is the standard Informix executable
and not a home grown script masquerading as the real thing.
TIA
Bryan Tonnet
Bryan Tonnet wrote:
> echo'ing $TERM/$TERMCAP just before fglgo verifies these two variables
> are set correctly. Shelling down at this point (to check the export)
> also verifies that TERM/TERMCAP are still OK.
Sorry, forgot to mention. For the Informix folk, I've also tried
INFORMIXTERM=termcap and terminfo with no luck.
Bryan Tonnet
On Tue, 24 Aug 1999 11:16:11 +1000, in article
<37C1F25B.BE7810B9@phase4.com.au>, Bryan Tonnet <batonnet@phase4.com.au> wrote:
>Bryan Tonnet wrote:
>
>> echo'ing $TERM/$TERMCAP just before fglgo verifies these two variables
>> are set correctly. Shelling down at this point (to check the export)
>> also verifies that TERM/TERMCAP are still OK.
>
>Sorry, forgot to mention. For the Informix folk, I've also tried
>INFORMIXTERM=termcap and terminfo with no luck.
What value are you setting TERM to? Also, if you're setting to Termcap, do you
specify where it is?
TERMCAP=$INFORMIXDIR/etc/termcap
export TERMCAP
--
for i in databasix.com ntrnet.net primenet.com ; do ; gburnore@$i ; done
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DOH! | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
spamgard(tm): zamboni | Official Proof of Purchase
===========================================================================
PGP Public Key: http://www.databasix.com/~gburnore/pubkey/pubkey.html
===========================================================================
Gary L. Burnore wrote:
> What value are you setting TERM to? Also, if you're setting to Termcap, do you
> specify where it is?
If my previous posting didn't get to you, here's a repeat of the
script I am attempting.
------
#!/bin/sh
# Setup standard environment
TERM=wy60 export TERM
TERMCAP=/app2/pmsinf/termcap export TERMCAP
INFORMIXDIR=/app1/informix7 export INFORMIXDIR
INFORMIXSERVER=ranger_pd export INFORMIXSERVERDBCENTURY=C export DBCENTURY
DBPATH=/app1/pmsinf/dbs:/app2/pmsinf/runtime/lib export DBPATHDBEDIT=vi export DBEDIT
DBDATE=DMY2/ export DBDATEDBTEMP=/tmp export DBTEMP
PATH=/app2/pmsinf/scripts:$INFORMIXDIR/bin:$PATH export PATH
LPPICK=2391b export LPPICK
DEFWARE="NS" export DEFWARE
# Run this
cd /app2/pmsinf/runtime/programs/pickprint
fglgo pickprint NS % \\"\\" 2391b X 1 D
------
TERM appears irrelevant to the problem. I've tried ansi types, vt
types and wyse types with the same result. D'Oh!
Bryan Tonnet
On Tue, 24 Aug 1999 10:51:38 +1000, Bryan Tonnet <batonnet@phase4.com.au> wrote: What user is cron executing this script as? Are the permissions on the termcap ok for what user cron is running this as?
In article <37C129CA.2E9EB361@phase4.com.au>, Bryan Tonnet <batonnet@phase4.com.au> writes >I have recently upgraded a system from SCO Openserver 5.0.2 to >5.0.5a and am having a large problem with cron running Informix RDS >7.20 programs. > >Regardless of the environment in which I run my cron jobs, my RDS >programs report; error -1170, Terminal is unknown to the system. > >Now I've tried everything I can think of to get these beasties to run. >I've set TERM and TERMCAP at various places around the script that >cron is running, and echo'ed it back to log files for checking. No >luck, but no question that all of the environment is set correctly >before the final fglgo which runs the program. > I've seen this before. Try removing any options statements from the program or at least make sure that they do not get executed if the program is not connected to a terminal. IF NOT run_in_background THEN OPTIONS ACCEPT KEY... END IF I think that the options statements do something (e.g. ioctl's) that expect to be talking to a terminal. NOTE: display statements work ok, only options statements cause a problem!! >Bryan Tonnet >batonnet@phase4.com.au -- David Williams
Related threads
- Re: "IDS seems to have shutdown cleanly"
- What are best onconfig parameters for a DSS app
- "IDS seems to have shutdown cleanly"