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

1. From a TACL prompt:
WHO
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 $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"
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 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.
Managing OSS Process Scheduling
A frequently used process might not obtain adequate processor time when it runs with a default
priority. If that happens, you can assign a nondefault priority to the process.
In the Guardian environment, you would write a CMON process to control the scheduling of other
processes. In the OSS environment, you can start processes with nondefault priorities using the
OSS nice command. You can also use a shell script or a shell alias to achieve this result.
Normal Guardian environment mechanisms for changing process priorities also can be used on
OSS processes.
An OSS program can modify its own scheduling priority by changing its nice value. Note that
the priority value assigned using the nice() function in an OSS program or using the nice
command is not the same value as that used for Guardian environment commands. Whether an
increased value indicates an increased or decreased priority depends on the environment in which
you use a command. The Guardian environment convention for relative scheduling priority is the
opposite of the UNIX convention used in the OSS environment.
Managing OSS Processes 69