HP-UX System Administrator's Guide: Routine Management Tasks HP-UX 11i v3 (B3921-90023, September 2010)

are prompted to log in, but occasionally, if something has gone wrong (for example if
a critical subsystem has failed to start for some reason) you may want to abort the boot.
You can do this by entering
Control-|
CAUTION: You should now shut down the system immediately.
Customizing Start-up and Shutdown
This section explains how to make applications and services start automatically on
boot and stop on shutdown.
To automate starting and stopping a subsystem you need to do all of the following:
1. Decide at what run level(s) you want the subsystem to start and stop.
Typically, subsystems get stopped at one run level lower than the one they were
started in, so a subsystem started at run level 3 will be stopped at run level 2. You
will probably want to start your subsystem at level 1, 2 or 3.
Generally, these run levels perform the following functions:
Run level 1: minimal system configuration
Run level 2: multi-user services, except NFS server
Run level 3: NFS server (to share local file systems)
To see exactly what is being started on your system at each run level, look at
/sbin/rcn.d/S*, where n is the run level.
Unless your subsystem depends on NFS-export services such as rpc.mountd and
nfsd, run level 2 is a good place to start it.
Run level 2 is a safe, as well as usually a logical, choice because it has a placeholder
which HP guarantees will not be overwritten by future releases of HP or third-party
software; there is no such placeholder, and hence no such guarantee, at the other
run levels.
2. Write a script to start and stop the subsystem, and an accompanying configuration
script to tell the boot process whether or not this script should be run.
Use the template /sbin/init.d/template; see the example below.
3. Create symbolic links that will cause your script to be run at the right place in the
boot and shutdown sequences.
See the example below.
4. Reboot the system to make sure everything works.
On a busy system, this may be inconvenient, but beware of testing on a
configuration other than the one on which your subsystem will actually run; any
Customizing Start-up and Shutdown 79