Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Booting and Shutdown
Customizing Start-up and Shutdown
Chapter 5 519
Since HP guarantees that scripts using the number 900 in run level 2
will not be overwritten when we upgrade the system or add HP or
third-party software, and run level 2 is a good place to start the
web_productname daemon, we assigned our script number 900 and
linked it into the /sbin/rc2.d directory:
ln -s /sbin/init.d/web_productname /sbin/rc2.d/S900web_productname
The S indicates “start” and the 900 determines starting order within
the run level, so our script starts late (currently last) in run level 2.
Similarly, HP guarantees scripts using the number 100 in run level 1 will
not be overwritten, so we also assigned our script the number 100 and
linked it into the /sbin/rc1.d directory, this time with a K (for “kill”)
code letter:
ln -s /sbin/init.d/web_productname
/sbin/rc1.d/K100web_productname
This means that the web_productname daemon is stopped after most
other functions in run level 1 as the system shuts down.
Step 4. Test the script itself, and test that it works correctly in the start-up and
shutdown processes.
Run /sbin/init.d/web_productname several times “by hand” to debug
it, then install it (as described in step 3 above) on a test system which
you re-booted to test that the daemon was started and stopped correctly,
then finally install it on the production system and reboot that system.