Practically Agile

Using Agile in less-than-perfect situations since Y2K

Informix on a Mac, Part 2

Yesterday, I posted my technique for installing Informix on a Mac. Well, it turns out I wrote just a bit too soon. What I had was indeed working, but only for the “dbaccess” tool that ships with Informix. Trying to connect from a Java (JDBC) application failed.

Thanks to Eric Herber’s comment on that post, the PDF [PDF no longer there. I have not yet found a replacement.] it mentions, and a bit more research, I was able to make a two significant updates to my installation.

Group Settings

Reading through the PDF, it notes that the informix user and group are required in order for things to work properly. Examining my install, it seems that the IDS installer tried to create the informix group, but somehow assigned it the same group ID as the _lpoperator group. I believe _lpoperator is the group of people who can use the Mac’s printers. Regardless, it wasn’t the informix group that it should have been.

Important! If you don’t understand what is meant by user and group here, my best advice would be to get someone who does to help you. I don’t want to insult anyone, but making changes to the things I am about to mention could render your machine unusable. Here be dragons!

To fix this issue, I had to do two things. First, create the informix group and make it the informix user’s “primary” group. Second, I had to change the group ownership of everything in my Informix install directory from _lpoperator to the new informix group. The PDF talks about using the Workgroup Manager that is available in the OS X Server Admin Tools. I will let you read that for the details except to say that the correct URL for acquiring the tools depends on the version of OS X you have. Regardless, the URL in the PDF is outdated, as is one I found in a search on MacOSXHints. The best means I have found is to go to the Apple Support site’s Advanced Search, enter “server admin tools”, select the radio button to match all keywords, use the drop-down to restrict the document type to “Downloads”, and pick the version you want from the results. I am far from certain, but it would make sense to pick the one closest to your version of OS X.

Once you have the Server Admin Tools download, it is a simple, and typical Mac install. Once installed, you can run the Workgroup Manager tool more or less as stated in the PDF. Do not skip the step that asks you to select “Show All Records” from the “View Menu”. This may be “Show System Records” depending on the version of the tool. If you know a little about Unix user management, the tool is fairly intuitive. If you know a lot about Unix user management, you may prefer the command line tools that can do the same thing. Regardless, I simply had to create the informix group and make it the informix user’s primary group.

It is worth noting that if I had created the informix user and group using this tool before running the installer, I probably would not have had the _lpoperator nonsense nor would I have had to do the next step: changing the group ownership of all the files in my Informix install.

To change the group ownership, I went back to the command line and did the following:

$ cd /Applications/IBM/informix
$ ls -l
total 11656
drwxr-xr-x    3 root      staff         102 Aug 15  2008 CSDK
drwxr-xr-x    5 root      staff         170 Aug 15  2008 DBLD
drwxr-xr-x    3 root      staff         102 Aug 15  2008 ICONNECT
-rw-r--r--    1 root      staff        5904 Aug 14  2008 README.html
drwxr-xr-x    7 root      staff         238 Aug 15  2008 SERVER
drwxrwxr-x    4 informix  _lpoperator      136 Jan 13 15:50 aaodir
drwxr-xr-x  109 informix  _lpoperator     3706 Jan 13 15:54 bin
-rwxr-xr-x    1 root      _lpoperator    29713 Aug 14  2008 uninstallserver
$ sudo chgrp -R informix aaodir

Note: The “…” on line 11 means there were a lot of other entries. The one at the end means that I repeated that “sudo chgrp” for all of the files and directories that had group ownership of _lpoperator.

The “sqlhosts” File

That group information was annoying and tedious to fix, but it was not really the problem. If you recall from the earlier post, there are some environment settings that need to be loaded. One points to a file that is very important to enabling clients to connect to the server: INFORMIXSQLHOSTS. The whole purpose of the file is to define the mechanisms by which clients can connect, this means whether they must be using shared memory space or can use sockets and what port they use to connect. The one created by the installer for the demo database has a single line that looks like this:

demo_on    onsoctcp    yoda.local    9088

The first is the dbservername and is correct for the demo database. The second is a three-part string that identifies how clients can connect. In short, “on” means a regular database server (short for on-line as in OLTP maybe), “soc” means sockets as opposed to “shm” for shared memory, and “tcp” means the network protocol. So, this seems right as well. The other two entries are the machine hostname and the port. However, although my Mac is named “Yoda” (yes, I’m a Star Wars geek), that is not listed in the /etc/hosts file. I changed this to “localhost” which is in the hosts file. Finally, that last entry is meant to be the service name from the /etc/services file, not the port number. To figure out how to change this, I used the following command:

$ cat /etc/services | grep Informix
sqlexec         9088/tcp    # IBM Informix SQL Interface
sqlexec         9088/udp    # IBM Informix SQL Interface
sqlexec-ssl     9089/tcp    # IBM Informix SQL Interface - Encrypted
sqlexec-ssl     9089/udp    # IBM Informix SQL Interface - Encrypted

My final file still contains one line, which looks like this:

demo_on    onsoctcp    localhost    sqlexec

And now, everything is working smoothly. Whew!

Tags: , , , ,

. 15 Jan 10 | Programming

Reader's Comments

  1. Installing Informix on Mac OS X 10.6 (Snow Leopard) | Practically Agile | January 15th, 2010 at 5:59 pm

    [...] below led to an issue with the “informix” user’s group settings. I have created a “part 2″ post to detail what happened and how I managed to fix it. Please read that before using these [...]

  2. Bronius | October 12th, 2010 at 9:33 am

    You forgot to mention the added difficulty of installing software while someone holds a gun to your head. Well, that’s an assumption on my part: With my limited experience with Informix multirelational dbms, I don’t know why anyone in his right might would voluntarily choose it as a back end…