Informix on Linux logo

This article is dedicated to a number of hints to help you set up quickly Informix products on a Linux box. Note that although originally written for SCO ports under iBCS emulation, most of the contents of this document equally applies to Linux native ports.
I'm trying to keep this at a basic level, partly in the hope that more people will be interested in using Informix products on Linux, and, of course, to masquerade my own ignorance on the subject :-)

TZ environmental variable

Linux time conversion functions (tzset, to be precise) gather timezone info from file /usr/lib/zoneinfo/localtime, should TZ not be set. A side effect of this convenient alternative is that TZ has quietly disappeared from your average /etc/profile.

This is fine for native Linux apps, but not for SCO's running on iBCS, so you have hack /etc/profile to set TZ, or today and current will listen to Big Ben.
To avoid the hassle of changing TZ whenever DST is/isn't in effect, use the following two liner:

TZ=`echo -e \`date +%Z\`'\c'; expr \`date -u +%H\` - \`date +%H\``
export TZ

It will recompute TZ from the localtime file at each login.
This, of course, will not work on timezones not differing from GMT by a whole number of hours.

Termcap & Terminfo

Both terminfo and termcap files are provided with the ncurses package, and both are supported by SCO ports of Informix products. While termcap needs some hacking (since, for instance, Informix uses kf & kg instead of kP & kN), terminfo files provided with the ncurses package (with the notable exception of the vt320 definitions) work pretty well with Informix products, and need only minor adjustments.
The enclosed termcap can be safely installed under /etc (remember to back up the old one!). On the contrary you should compile terminfo definitions (or store my terminfo files) in an appropriate directory, say /usr/informix/terminfo, as outlined in the sample installation procedure below

$ mkdir /usr/informix/terminfo
$ TERMINFO=/usr/informix/terminfo
$ export TERMINFO
$ tic linux.ti

Failing to correctly set the TERMINFO variable will clutter your standard terminfo files, so be careful!
As usual, you would access the newly created terminfo files by suitably setting the INFORMIXTERM variable as per 4gl Reference Manual, volume two, appendix I, and again, with TERMINFO pointing to the alternate terminfo definitions. The purist among you may want to have separate termcap definitions as well. For this just install the alternate termcap somewhere and have the variable TERMCAP pointing at it.

Printing

The Printing-Howto goes in great length to explain the ladder effect, and how to effectively use a filter to prevent it, only to conclude that printing ascii text is not this hot thing, and that you should seek a magic filter that allows you to print PostScript, TeX, you name it files.

What they don't tell you is that no single LPR filter is included in the LPRng distribution, and that 4gl reports only produce plain ascii text (well, ok, if you haven't read the Informix Faq Appendix M, or don't happen to use 4glWorks, but that's another story :-)

Here you have a few alternatives:

The last two options will let you control things like orientation, paper size, bin, etc.

Starting and stopping the engine automatically

Can be easily done by placing a small shell script, like the following, in the appropriate initialization scripts directory.

--------------------------------- cut here --------------------------------
#!/bin/sh
:	"@(#)/etc/rc.d/rc.informix	0.0"
#	rc.informix  -  Informix engine startup system initialization script
#
#	Author:	Marco Greco, <marco@4glworks.com>, Catania, Italy
#
#	Initial release: Jun 97
#	Current release: Jul 97
#
#	Absolutely no warranty -- use at your own risk

export INFORMIXDIR=		#fill in your value here, maybe /usr/informix?
export INFORMIXSERVER=		#fill in your value here
export ONCONFIG=		#fill in your value here

if [ $# -lt 1 ]
then
    echo "Usage: $0 {start|stop}"
else
    case "$1" in

    'start')
	if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c initialized` -ne 0 ]
	then
	    echo -n "Starting Informix Online... "
	    $INFORMIXDIR/bin/oninit
	    echo "done"
	fi
	;;

    'stop')
	if [ `$INFORMIXDIR/bin/onstat 2>&- | grep -c initialized` -eq 0 ]
	then
	    echo -n "Shutting down Informix Online... "
	    $INFORMIXDIR/bin/onmode -ky
	    echo "done"
	fi
	;;
    *)
	echo "Usage: $0 {start|stop}"
	;;
    esac
fi
---------------------------------- end cut --------------------------------

[Note that this only applies to Online since there's nothing to start on SE unless you require network functionality, which is not available at the present time]

All of Red Hat, SuSE and Caldera have a System V approach to system initialization, thus you need to

Slackware uses the SysVinit package unmodified, which takes a BSD approach, thus you would place the above script as a replacement for /etc/rc.d/rc.local. Note that for some reason the plain SysVinit package does not offer a way to stop what has been started by /etc/rc.d/rc.local, so for our little scheme to work you need to


This page maintained by marco greco
(last updated Mar, 8 2000)