HP-UX HB v13.00 Ch-03 - System Startup

HP-UX Handbook Rev 13.00 Page 5 (of 14)
Chapter 03 System Startup
October 29, 2013
Configuration Files - /etc/rc.config.d/*
The system configuration used at startup is contained in files within the directory
/etc/rc.config.d. The script /etc/rc.config sources all of the files within
/etc/rc.config.d and /etc/TIMEZONE and exports their contents to the environment.
/etc/rc.config
The file /etc/rc.config is a script that sources all of the /etc/rc.config.d/* scripts, and
also sources /etc/TIMEZONE. To read the configuration definitions, only this file need be
sourced. This file is sourced by /sbin/rc whenever it is run, such as when the init command is
run to transition between run states. Each file that exists in /etc/rc.config.d is sourced,
without regard to which startup scripts are to be executed.
# cat /etc/rc.config
# This script sources configuration files for various subsystems. Configuration
# variables are in files CFG_FILE in /etc/rc.config.d/*, and /etc/TIMEZONE.
# Simple error checks are done: test file perms and for dumped "core" files.
# Filenames containing [.,~#] are not sourced - they are possible names of
# backup files such as file.bak, file.OLD, ~file, file~, file,v, #file etc.
#
# @(#)B.11.11_LR
for CFG_FILE in /etc/rc.config.d/* /etc/TIMEZONE
do
fname=${CFG_FILE##*/} # get file basename
if [ -f $CFG_FILE -a "$fname" != "core" -a "${fname##*[.,~\#]}" = "$fname" ]
then . $CFG_FILE # source a valid config file
fi
done
/etc/rc.config.d
The configuration information is structured as a directory of files, rather than as a single file
containing the same information. This allows developers to create and manage their own
configuration files here, without the complications of shared ownership and access of a common
file.
NOTE: Do not store any other files but valid configuration files into this directory. It would be
sourced by rc.config at startup and result in errors being logged to /etc/rc.log. It is not seldom
that files named e.g. ioscan.out or netconf.old are left in this directory ;-)
/etc/rc.config.d/*
This is where files containing configuration variable assignments are located. Configuration