Open System Services Management and Operations Guide (G06.30+, H06.08+, J06.03+)
tail -f log
from an OSS shell prompt at a dedicated operator console. To make this process persistent,
enter the following commands:
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 for the NonStop Kernel subsystem:
ADD PROCESS OSSAPP,
NAME $OSH1,
AUTORESTART 10,
HOMETERM $ZTN0A.#PT4KH30,
PRIMARYCPU 1,
STARTMODE MANUAL,
USERID OSS.APPS,
PROGRAM $SYSTEM.SYSTEM.OSH,
ASSOCPROC $OSS1,
STARTUPMSG "-ls -name /G/oss1 -p /bin/tail -f log"
3. Because the configuration uses a STARTMODE of MANUAL, you must enter the following
command at an SCF prompt to start the process:
START PROCESS $ZZKRN.#OSSAPP
These commands configure and start the persistent process object OSSAPP in processor
1, using the named process $OSH1 to launch the OSH utility. Then OSH launches the
named process $OSS1 that runs the program (-p) /bin/tail as if it were a login shell
(-ls); the tail utility uses the file (-f) named log in the home directory of the user with
the user ID OSS.APPS. Because of the -ls flag, the tail command 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
$OSH1 and $OSS1 processes. If either process fails, the persistence manager aborts
the remaining process and makes up to 10 attempts to restart $OSH1.
To stop the persistent process object, enter the following command at an SCF prompt:
ABORT PROCESS $ZZKRN.#OSSAPP
This command stops both the $OSH1 and $OSS1 processes. $OSS1 is stopped such
that it does not create a zombie process.
• Suppose your site has a shell script with the filename startmyapp. One of the tasks performed
by startmyapp (starting an application program named myapp) needs to be done by a
persistent process. startmyapp contains the following:
#! /bin/sh
#
PATH=.:/usr/ucb:/usr/bin:/bin;
export PATH;
CONFIGURATION = $1;
#
run -name=/G/oss2 myapp $CONFIGURATION
where the value passed to myapp through the variable CONFIGURATION is supplied as a
command line parameter ($1) each time startmyapp is invoked.
To configure and run myapp as a persistent process that uses the CONFIGURATION value of
reload, enter the following commands:
1. From a TACL prompt:
WHO
Managing OSS Processes 67