HP-UX HB v13.00 Ch-03 - System Startup
HP-UX Handbook – Rev 13.00 Page 7 (of 14)
Chapter 03 System Startup
October 29, 2013
Execution Scripts - /sbin/init.d/*
Each of the scripts in /sbin/init.d/ deals with one application or one subsystem, such as NFS
server daemons. A single script in /sbin/init.d/ must be able to start up an application (or
subsystem) or kill it. The script will be passed the command line parameter 'start' or 'stop'
depending on whether it is supposed to start or kill the appropriate daemons.
In some cases, only a start action will be applicable. If this is the case, and if the stop action is
specified, the script should produce a usage message and exit with an error. In general, scripts
should look at their arguments and produce error messages if bad arguments are present. When a
script executes properly, it must exit with a return value of zero. If an error condition exists, the
return value must be nonzero.
The modularity is important, i.e. there should be no script invoking another script. Modifying the
scripts to change the behaviour is not permitted. This should be done by modifying the variables
in the Configuration Files.
Arguments
The Execution 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 argument 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.