Background
I am working with a client that has had ITIM and TDI/IDI installed and running for over a decade, with different groups responsible for the administration of each. They now have around ten ibmdisrv processes running, with some of them configured to run the same Listener ALs (so the one that starts first wins). None of the servers are started with the "-s" flag, so it's a little difficult to figure out their solution directories.
Each ibmdisrv and ibmditk process needs to have a Solution Directory (aka SOLDIR, SolDir, or current working directory) defined. All default logging is done in the solution directory, and all relative paths used are relative to the solution directory. Basically, the solution directory is very important, and this post will show you how you can find it for a running process.
The solution shown here is for Linux, because that is the most common OS I've seen for running IBM Directory Integrator. The second most popular platform is Windows. If you're running Windows, you can get similar data using the
Process Explorer GUI tool.
Solution
The first thing to look at is the process listing for the IDI server java process. The easiest way to find all of these processes running on your server is with this command:
# ps -ef | grep IDILoader
root 5693 5683 0 Jan01 pts/0 00:07:57 /opt/IBM/TDI/ceV10/jvm/jre/bin/java -cp /opt/IBM/TDI/ceV10/IDILoader.jar -Dlog4j2.configurationFile=file:etc/log4j2.xml --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED com.ibm.di.loader.ServerLauncher -d
We see from that output that the PID of this java process is 5693 and the Parent PID (PPID) is 5683. The most straightforward way I've found to find the SolDir for this server is using this command:
# lsof -Pp 5693 | grep cwd
The output should be similar to:
java 5693 root cwd DIR 253,0 4096 68731158 /opt/IBM/TDI/prod_V7.1.1
Easy as that, we see that the SolDir for this server is /opt/IBM/TDI/prod_V7.1.1.
Additional Details
We can get more details about the PPID with this command:
# ps -fwwp 5683
UID PID PPID C STIME TTY TIME CMD
root 5683 5462 0 Jan01 pts/0 00:00:00 /bin/sh /opt/IBM/TDI/ceV10/ibmdisrv -d
What we see here is that the
/opt/IBM/TDI/ceV10/ibmdisrv script was called with only the "-d" flag to start this process. When that script runs, it calls the
bin/setupCmdLine.sh script, which eventually calls the script
bin/defaultSolDir.sh to set the solution directory of the process. (
A great post about this and more can be found at this link.) While this is truly great information to know, one drawback is that the solution directory can be overridden with the TDI_SOLDIR environment variable. That's why I like the lsof approach better on Linux. The behavior of lsof on AIX is different and doesn't point to the solution directory like it does on Linux, so this approach may be better there. In either case, it's good to know both.