- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: rc.config.d files - All all files read into me...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 09:02 AM
тАО03-27-2001 09:02 AM
I recall a statement from an HP instructor that all variables in /etc/rc.config.d were loaded upon boot prior to running the rc.#d startup scripts. This would indicate that there could be major problems if multiple variable files, had the same variables.
Would someone please confirm this statement. I have seen previous variable files saved with extensions, as in netconf.old, netconf.new, etc.
jack...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 09:06 AM
тАО03-27-2001 09:06 AM
Re: rc.config.d files - All all files read into memory upon boot before starting apps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 09:21 AM
тАО03-27-2001 09:21 AM
Re: rc.config.d files - All all files read into memory upon boot before starting apps
Most of the scripts in /sbin/init.d call the /etc/rc.config script, which in turn does the following:
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##*[.,~\#]}" = "$fnam
e" ]
then . $CFG_FILE # source a valid config file
fi
done
As a result, if any of the scripts in /etc/rc.config.d fail for any reason, then many of the vital subsystems (inetd, for instance) will not start up correctly.
Likewise, it is also very dangerous to keep 'backup' copies of your rc.config.d files in the same directory, else whichever file comes last in lexicographic order will be used. (I've seen this happen when people have both a netconf and netconf.orig file).
I hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 09:31 AM
тАО03-27-2001 09:31 AM
SolutionYou should have a look at man page rc.config(4). Here is an excerpt:
--snip--
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.
[...]
Note that there must be no requirements on the order of the files sourced. This means configuration files must not refer to variables defined in other configuration files, since there is no guarantee that the variable being referenced is currently defined. There is no protection against environment variable namespace collision in these configuration files. Programmers must take care to avoid such problems.
--snip--
Besides, if you look at /etc/rc.config code, you'll see that minimum checks are performed, and that /etc/rc.config.d/scripts.with.a.dot.in.their.name will NOT be sourced (thanks to variable substitutions), thus allowing backup configuration scripts such as /etc/rc.config.d/netconf.OLD to remain in their original directory.
I hope this helps !
Best regards,
Fred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 10:20 AM
тАО03-27-2001 10:20 AM
Re: rc.config.d files - All all files read into memory upon boot before starting apps
This question has come up before in similar forms. The script posted by Kenneth is the actual code from /etc/rc.config.
This script SKIPS files whose basename contains the characters between the square brackets, namely the period (.), the comma (,), the tilde (~) and the hash (#).
Thus, you CAN SAFELY have backup copies of a file called "myfile" where these backup copies are named : myfile.bak, myfile.old, myfile~lastone, etc. In cases like this, only "myfile" would be sourced by /etc/rc.config.
The man page noted by Frederic makes ample note of the sourcing order (lexographically) and of the warning for one script (source) NOT to assume another script (source) has provided an environmental variable for it.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2001 12:00 PM
тАО03-27-2001 12:00 PM