posted 22 years ago
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 ]
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.