Choosing a location for $INFORMIXDIR

jleffler's picture

IBM Informix Dynamic Server (IDS) is installed in a directory which is identified by the INFORMIXDIR environment variable at run-time. IDS does little checking on what values of $INFORMIXDIR are used in terms of the name (but there is fairly stringent checking on the permissions associated with the directory identified by the name). This article suggests a simple guideline on how to choose a value for $INFORMIXDIR.

An original version of this article contained a huge table of directories known to exist on various systems that should not be used, but a key observation simplified the whole process, almost to the point of making the whole process trivial.

As a rule-of-thumb, you should not use a pre-existing directory for $INFORMIXDIR.

  • You should create the directory specifically to contain IDS.

Using a pre-existing directory created by the operating system is almost always a bad idea.  (It is very tempting to say 'it is always a bad idea'; I can't think of an exception to the rule.  Can you?)

The default value assumed for $INFORMIXDIR is /usr/informix. Note that IDS does not prohibit you from using a symbolic link as the directory identified by $INFORMIXDIR. It will follow that link – after making sure that it is safe to do so.  So, /usr/informix could be a symbolic link to somewhere more obscure.

The value of $INFORMIXDIR should not contain blanks. This applies on all platforms, not just MacOS X or Windows, though those are the platforms where users most readily use blanks in pathnames. The restriction might be removed in a future version of IDS (and CSDK), but there a numerous places where it will not work with current versions of IDS. When the restriction on names with blanks is removed (currently scheduled for a fix-pack of IDS 11.50), further directories on Windows and MacOS X could be listed; currently, they are excluded because the name contains blanks.  However, the overriding principle ('you create $INFORMIXDIR') still applies, and means that the names containing blanks do not need to be listed separately

The total length of $INFORMIXDIR must be short enough to allow two names to fit into a character buffer of length 256 bytes, including the terminal null. The names are:

    1.  $INFORMIXDIR/etc/onconfig.std
    2.  $INFORMIXDIR/etc/$ONCONFIG

The first of those names limits $INFORMIXDIR to 238 characters; if the value of $ONCONFIG is longer than 'onconfig.std', then the maximum length of $INFORMIXDIR is that much shorter. In practice, this limitation is seldom a problem. Given that you can set $INFORMIXDIR to point to a symbolic link to a longer name, it is unlikely that this limit will be increased.
In general, it is a good idea to avoid approaching the limit too closely.  The names and lengths cited are checked during the start-up; there could be other names that cause problems if you use a path to INFORMIXDIR approaching, say, 200 bytes.  This is seldom a practical problem.