Scripts fail after upgrade to 11.50.C7
Posted in 2011
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Networking & sqlhosts Configuration, Platform-Specific Issues
Recently upgraded to Informix 11.50 C7 on HP-UX v11.24. We have some DBACCESS
scripts that are returning the following error when run unattended:
informix:/apps/informix/fnsbscripts/us $ more taxstats.20110214
Read error on stdin: stdin is /dev/null.
informix:/apps/informix/fnsbscripts/us $
These scripts run when run manually. I am not in-depth into Informix/UNIX and
have no clue at this point except to believe it is a parameter somewhere I
need to change. Here is the script I am trying to run unattended:
#!/bin/sh
# process.webtaxes will create records for the webtaxes table to be
# used as the source of tax information on the Borough web site Property
# database pages.
#
fn=`date +%Y%m%d`
export INFORMIXDIR=/apps/informix10
export PATH=$INFORMIXDIR/bin:${PATH}export
SHLIB_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:/usr/lib:/apps/tacs/run:${SHLI
B_PATH}
# export TERM=vt220-8export TERM=vt100
export INFORMIXSERVER=tax10_tcp
export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.tax10export TERMCAP=$INFORMIXDIR/etc/termcap
export INFORMIXTERM=terminfoexport DBCENTURY=C
export DBMONEY=.
# export MORE="-f -s"
export HOME=/apps/tacs
cd /apps/tacs/webtaxes
# mv /transfer/wti.txt /transfer/wti.txt.old
dbaccess tax -qcr webtaxes >> /apps/tacs/webtaxes/webtaxes.out.${fn}
export TERM=vt220-8stty erase "^H" kill "^U" intr "^?" eof "^D" susp "^Z" hupcl ixon ixoff tostop
tabs
/usr/local/bin/console.chmod
cd /apps/tacs/run
/apps/tacs/run/webtaxes Y `date +%D` < /dev/console >
/apps/tacs/webtaxes.report
# /apps/tacs/run/webtaxes Y `date +%D` > /dev/null
export TERM=vt100
cd /apps/tacs/webtaxes
dbaccess tax -qcr unlwebtaxes >> /apps/tacs/webtaxes/unltaxes.out.${fn}
WTI=/transfer/wti.txt
# ! -s below tests for $WTI file having length of 0 meaning job has failed
if [ ! -s $WTI ]
then
echo "Web Tax History has prior day's data - Batch job failed `date
+%m%d%y`"|mail rhanlon@co.fairbanks.ak.us
# echo "Web Tax History has prior day's data - Batch job failed `date
+%m%d%y`"|mail bjacobs@co.fairbanks.ak.us
# cp wti.txt.old wti.txtexit
fi
If anyone could give me a hand and point me in the direction I need to go, I
would appreciate it and thank you in advance. You can also respond to me
directly at bjacobs@co.fairbanks.ak.us
As if I needed another reason not to like DB-Access!
On Wed, Feb 16, 2011 at 15:37, BRIAN JACOBS <bjacobs@co.fairbanks.ak.us>wrote:
> Recently upgraded to Informix 11.50 C7 on HP-UX v11.24. We have some
> DBACCESS
> scripts that are returning the following error when run unattended:
>
> informix:/apps/informix/fnsbscripts/us $ more taxstats.20110214
> Read error on stdin: stdin is /dev/null.
> informix:/apps/informix/fnsbscripts/us $
>
> These scripts run when run manually. I am not in-depth into Informix/UNIX
> and
> have no clue at this point except to believe it is a parameter somewhere I
> need to change. Here is the script I am trying to run unattended:
>
> #!/bin/sh
> # process.webtaxes will create records for the webtaxes table to be
> # used as the source of tax information on the Borough web site Property
> # database pages.
> #
> fn=`date +%Y%m%d`
> export INFORMIXDIR=/apps/informix10
> export PATH=$INFORMIXDIR/bin:${PATH}> export
>
>
SHLIB_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:/usr/lib:/apps/tacs/run:${SHLI
B_PATH}
> # export TERM=vt220-8> export TERM=vt100
> export INFORMIXSERVER=tax10_tcp
> export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.tax10> export TERMCAP=$INFORMIXDIR/etc/termcap
> export INFORMIXTERM=terminfo> export DBCENTURY=C
> export DBMONEY=.
> # export MORE="-f -s"
> export HOME=/apps/tacs
> cd /apps/tacs/webtaxes
> # mv /transfer/wti.txt /transfer/wti.txt.old
> dbaccess tax -qcr webtaxes >> /apps/tacs/webtaxes/webtaxes.out.${fn}
> export TERM=vt220-8> stty erase "^H" kill "^U" intr "^?" eof "^D" susp "^Z" hupcl ixon ixoff
> tostop
> tabs
> /usr/local/bin/console.chmod
> cd /apps/tacs/run
> /apps/tacs/run/webtaxes Y `date +%D` < /dev/console >
> /apps/tacs/webtaxes.report
> # /apps/tacs/run/webtaxes Y `date +%D` > /dev/null
> export TERM=vt100
> cd /apps/tacs/webtaxes
> dbaccess tax -qcr unlwebtaxes >> /apps/tacs/webtaxes/unltaxes.out.${fn}
> WTI=/transfer/wti.txt
> # ! -s below tests for $WTI file having length of 0 meaning job has failed
> if [ ! -s $WTI ]
> then
> echo "Web Tax History has prior day's data - Batch job failed `date
> +%m%d%y`"|mail rhanlon@co.fairbanks.ak.us
> # echo "Web Tax History has prior day's data - Batch job failed `date
> +%m%d%y`"|mail bjacobs@co.fairbanks.ak.us
> # cp wti.txt.old wti.txt> exit
> fi
>
> If anyone could give me a hand and point me in the direction I need to go,
> I
> would appreciate it and thank you in advance. You can also respond to me
> directly at bjacobs@co.fairbanks.ak.us
>
I tried this:
$ dbaccess stores xx.sql </dev/null >xx.out
Database selected.
117 row(s) retrieved.
Database closed.
$ dbaccess stores -qcr xx </dev/null >xx.out
$ cat xx.out
Read error on stdin: stdin is /dev/null.
$
So, with the '-qcr' notation, redirecting from standard input generates the
error. Since using 'dbaccess database file' notation (the .sql suffix is
optional - I checked) works, all you have to do is drop the '-qcr' options
in your script.
You should probably also report a bug - the 'error message' indicates that
the code is not set up to work all that sanely. IMNSHO, of course. (And
I'm curious to know how much work they put into finding out that it is
/dev/null that is used for standard input - I really don't see why you'd
want to generate that message just because you got EOF on standard input.)
I don't know when the change was made or why; the error is better than
spinning in a loop, but not better than quietly exiting.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--001636c5be906078f1049c74208f