Part 2 looks at a more obscure case of this error. Here's an email I received last week:
I installed a Cygwin environment and a telnet server on our Windows 64-bit machine.I can now access the machine and log-in as informix to a nice UNIX-like bash shell. However I would like to access the informix server from this shell. When I have defined INFORMIXDIR/INFORMIXSERVER etc. However I always end up with ERROR could not initialize security subsystem.Since this is usually a problem accessing the Informix part of the registry, my first thought was that this had something to do with Cygwin being 32-bit and not being able to access the 64-bit registry keys under HKEY_LOCAL_MACHINE\Software\Informix. With hindsight this couldn't be the problem, since it would be the 64-bit IDS utilities which access the registry keys, not Cygwin.
Strangely the problem only occurred when connecting via the telnet server. A Cygwin shell executed via Remote Desktop worked fine.
To investigate further, I used the Sysinternals utility Regmon to monitor which registry keys were accessed when the onstat utility was executed via a telnet session. This showed one problem - the Informix environment variables were being set in a "DOS format" environment shell, which added an extra linefeed character at the end of the INFORMIXSERVER environment value. This showed up as a mysterious block at the end of the Registry access string in Regmon.
Once the environment variables were fixed, onstat would still not run in the telnet session. It failed with:
GLS initialization failed, error -23101
This error is usually indicative of an incorrect DB_LOCALE, CLIENT_LOCALE, SERVER_LOCALE or INFORMIXDIR environment variable. In this case INFORMIXDIR was set as follows:
This was the problem. It was fine to use "/cygdrive/C/PROGRA~1/IBM/IBMINF~1/11.10/bin" in the PATH, but "/cygdrive" did not mean anything to onstat which is unaware of the Cygwin environment. The correct setting for INFORMIXDIR was:
Once this was set, running IDS command line utilities via a Cygwin telnet session worked correctly.