I came across a problem with visualising the status of an AIX service. So first I create subsystem pointing to a shell script which I will use for running.
mkssys -s testService -p /etc/rc.d/init.d/runScriptWithCatalina.sh -u 0
Now if I start the service as
startsrc -s testService -a "start"
, it shows that the subsystem has been started.
0513-059 The testService Subsystem has been started. Subsystem PID is 9502912.
and the service is working indeed. However, when I check the subsystem status with
lssrc -a
, it shows that it is inoperative. I figured out that the reason behind this is when the subsystem is started, it calls the runScriptWithCatalina.sh which calls the catalina.sh script to start and the catalina.sh forks and creates new process and the subsystem cannot detect it, that is why it shows it is inoperative.
Here is the catalina script - https://github.com/magro/msm-sample-webapp/blob/master/runtime/apache-tomcat-6.0.32/bin/catalina.sh. The tomcad.pid file contains pid different from the subsystem PID shown 9502912.
Is there a solution or workaround for this, or another approach?