Open System Services Management and Operations Guide (G06.29+, H06.07+)

Operating the OSS Environment
Open System Services Management and Operations Guide527191-005
2-29
Making OSS Application Processes Persistent with
the Kernel Subsystem
To configure and run myapp in all processors as a persistent process that uses the
CONFIGURATION value of reload, enter the following commands:
a. From a TACL prompt:
WHO
which produces output that includes the HOMETERM value you need to use,
such as:
Home terminal: $ZTN0A.#PT4KH30
...
b. Then, at an SCF prompt, enter:
ADD PROCESS OSSAPP,
NAME $OSH,
HOMETERM $ZTN0A.#PT4KH30,
AUTORESTART 5,
CPU ALL,
STARTMODE MANUAL,
USERID OSS.APPS,
PROGRAM $SYSTEM.SYSTEM.OSH
ASSOCPROC $OSS,
STARTUPMSG "-ls -p /bin/sh launchmyapp reload"
c. Because the configuration uses a STARTMODE of MANUAL, you must enter
the following command at an SCF prompt to start the persistent process:
START PROCESS $ZZKRN.#OSSAPP
These commands configure and start the persistent process object OSSAPP in
all processors (00 through 15, assuming a 16-processor system), using the named
processes $OSH00 through $OSH15 to launch the OSH utility. Then each copy of
OSH starts a login (-ls) shell (-p /bin/sh) that executes the script
launchmyapp and passes the value reload to it.
Each copy of launchmyapp uses the OSS run command to start the program
(-p) myapp as the named process (-name) $OSSnn, where nn is the value of
$ZCPU for a specific processor. Because of the -ls flag, myapp inherits any
environment variables defined in either /etc/profile or $HOME/.profile for
the user ID OSS.APPS.
Once the SCF START command completes, the persistence manager monitors all
of the $OSHnn and $OSSnn processes. If any of these processes fails, the
persistence manager aborts the remaining process and makes up to five attempts
to restart the corresponding $OSHnn.
To stop the persistent process object, enter the following command at an SCF
prompt:
ABORT PROCESS $ZZKRN.#OSSAPP
This command stops all the $OSHnn and $OSSnn processes. Each copy of
$OSSnn is stopped such that it does not create a zombie process.