Open System Services Management and Operations Guide (G06.30+, H06.08+, J06.03+)

which produces output that includes the HOMETERM value you need to use, such as:
Home terminal: $ZTN0A.#PT4KH30
...
2. Then, at an SCF prompt, enter:
ADD PROCESS OSSAPP,
NAME $OSH2,
HOMETERM $ZTN0A.#PT4KH30,
AUTORESTART 5,
PRIMARYCPU 2,
STARTMODE MANUAL,
USERID OSS.APPS,
PROGRAM $SYSTEM.SYSTEM.OSH
ASSOCPROC $OSS2,
STARTUPMSG "-ls -p /bin/sh startmyapp reload"
3. 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 processor
2, using the named process $OSH2 to launch the OSH utility. Then OSH starts a login
(-ls) shell (-p /bin/sh) that executes the script startmyapp and passes the value
reload to it.
startmyapp uses the OSS run command to start the program (-p) myapp as the named
process (-name) $OSS2. 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 both the
$OSH2 and $OSS2 processes. If either process fails, the persistence manager aborts
the remaining process and makes up to five attempts to restart $OSH2.
To stop the persistent process object, enter the following command at an SCF prompt:
ABORT PROCESS $ZZKRN.#OSSAPP
This command stops both the $OSH2 and $OSS2 processes. $OSS2 is stopped such
that it does not create a zombie process.
Suppose the shell script with the filename launchmyapp must be run constantly in each
available processor because one of the tasks performed by launchmyapp (starting an
application program named myapp) needs to be done by a persistent process. launchmyapp
contains the following:
#! /bin/sh
#
PATH=.:/usr/ucb:/usr/bin:/bin;
export PATH;
CONFGURATION = $1;
#
run -name=/G/oss$ZCPU myapp $CONFIGURATION
where:
The value passed to myapp through the variable CONFIGURATION is supplied as a
command line parameter ($1) each time launchmyapp is invoked
The unique value used for the myapp process name consists of the base character string
"oss" and the number of the processor running the copy of the child process, derived by
appending the OSS environment variable $ZCPU to the base string.
To configure and run myapp in all processors as a persistent process that uses the
CONFIGURATION value of reload, enter the following commands:
68 Operating the OSS Environment