HP-UX Reference (11i v1 00/12) - 1M System Administration Commands N-Z (vol 4)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1m/naaagt.1m
________________________________________________________________
___ ___
r
rc(1M) rc(1M)
When ordering start and kill script links, note that subsystems started in any given
order should be stopped in the reverse order to eliminate any dependencies between
subsystems. This means that kill scripts will generally not have the same numbers as
their start script counterparts. For example, if two subsystems must be started in a
given order due to dependencies (e.g., S111house followed by S222uses_house),
the kill counterparts to these scripts must be numbered so that the subsystems are
stopped in the opposite order in which they were started (e.g., K555uses_house
followed by K777house).
Also keep in mind that kill scripts for a start script in directory /sbin/rcN.d will
reside in /sbin/rc(N-1).d. For example, /sbin/rc3.d/S123homer and
/sbin/rc2.d/K654homer might be start/kill counterparts.
Arguments
The startup/shutdown scripts should be able to recognize the following four arguments (where applicable):
start The start argument is passed to scripts whose names start with S. Upon receiving
the start argument, the script should perform its start actions.
stop The stop argument is passed to scripts whose names start with
K. Upon receiving
the
stop argument, the script should perform its stop actions.
start_msg The start_msg argument is passed to scripts whose names start with S so that the
script can report back a short message indicating what the start action will do. For
instance, when the lp spooler script is invoked with a start_msg argument, it
echoes
Starting the LP subsystem
This string is used by the startup routines. Scripts given just the start_msg argu-
ment will only print a message and not perform any actions.
stop_msg The stop_msg argument is passed to scripts whose names start with K so that the
script can report back a short message indicating what the stop action will do. For
instance, when the
lp spooler script is invoked with a stop_msg argument, it
echoes
Stopping the LP subsystem
This string is used by the shutdown checklist. Scripts given just the stop_msg
argument will only print a message and not perform any actions.
Script Output
To ensure proper reporting of startup events, startup scripts are required to comply with the following
guidelines for script output.
Status messages, such as
starting house daemon
must be directed to stdout. All error messages must be directed to stderr.
Script output, both stdout and stderr, is redirected to log file /etc/rc.log , unless the startup
checklist mode is set to the raw mode. In this case, all output goes to the console. All error mes-
sages should be echoed to stdout or stderr.
Startup scripts are not allowed to send messages directly to the console, or to start any daemons
that immediately write to the console. This restriction exists because these scripts are now started
by the
/sbin/rc checklist wrapper. All script output should go to either stdout or stderr, and
thus be captured in a log file. Any console output will be garbled.
RETURN VALUE
The return values for startup scripts are as follows:
0 Script exited without error.
1 Script encountered errors.
2 Script was skipped due to overriding control variables from /etc/rc.config.d files, or for
other reasons, and did not actually do anything.
3 Script will automatically reboot the system.
HP-UX Release 11i: December 2000 2 Section 1M689
___
___