• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
xiao gao
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18800
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
keerthidhar dongre
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!