IntelliJ Java IDE
The moose likes Linux / UNIX and the fly likes What is the difference in rc.local and rc3.d or rc5.d Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "What is the difference in rc.local and rc3.d or rc5.d" Watch "What is the difference in rc.local and rc3.d or rc5.d" New topic
Author

What is the difference in rc.local and rc3.d or rc5.d

xiao gao
Greenhorn

Joined: Oct 11, 2001
Posts: 21
Can anyone tell me what is the differencd in putting the start script of an application like resin which is httpd.sh in rc.local or rc5.d or rc3.d to boot the application?
Any security or performance different?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12510

The difference isn't in security or performance, it's in when the script gets executed. Scripts in rc.local get run after the system initially boots up. Each of the numbered directories contains softflinks to files in the init.d directory. If your system was at runlevel 2 and you switched to runlevel 5 (using the command "/sbin/init 5"), all the scripts whose (alias) names begin with "K" in /etc/rc.d/rc2.d will be executed in the order of their filenames (which have execution priority encoded in them) and passed the parameter value "stop". Then all the scripts in /etc/rc.d/rc5.d whose (alias) names begin with "S" are executed in the order of their filenames and passed the parameter value "start".
TO see how the whole thing is put together, read the man page for the "init" program ("man init") and look at /etc/inittab. If your system is setup anything like mine, you'll see the lines where the script /etc/rc.d/rc is executed when a runlevel changes and looking at /etc/rc.d/rc will show you the rest of the process.
And just to round things out, I should mention that the naming scheme is "rc" for "Run Control" and the ".d" is a convention indicating that the item is a directory instead of a file.
[ February 27, 2002: Message edited by: Tim Holloway ]

One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
keerthidhar dongre
Greenhorn

Joined: Jan 30, 2002
Posts: 26
Tim,
Thanks for a wonderful explanation. Though I have been using "rc" I had ignored to get to know that it means run control.
Regards,
Keerthi
 
 
subject: What is the difference in rc.local and rc3.d or rc5.d
 
Threads others viewed
setting up weblogic and oracle to at startup when I reboot the system
Increasing Disk Partition Size on Linux
How to auto start a process when Linux starts or reboot?
Tomcat daemon
softlink flashing in red!?
MyEclipse, The Clear Choice