When you start the agent under Solaris by using SMF, all the processes (jobs) that this agent starts will run in the same contract. The effect is that when this agent crashes, ends or is restarted, all its processes will also end. To solve this problems, you can separate the jobs from the agent contract so that they can run without being affected by the agent processes.
The following steps are required for this purpose:
Step 1: Create the two shell script files chk-AE-start.ksh and chk-uc4.ksh with the following contents:
chk-AE-start.ksh:
nohup /usr/local/bin/sudo -u mgws /var/tmp/chk-uc4.ksh&
chk-uc4.ksh :
while true
do
echo "$(date) $0" >> /var/tmp/chk-uc4.log
sleep 10
done
Step 2: In the job script, call the shell script chk-AE-start.ksh with the utility "ctrun" and at the beginning of the job script, insert the following line:
ctrun -l child /var/tmp/chk-AE-start.ksh