how do /rc.d scripts get executed?
I used to know this, but half an hour of searching has not refreshed my memory.
For slackware, startup files are in /etc/rc.d. Going to runlevel M (multiuser) causes /etc/rc.d/rc.M to get executed. It runs a bunch of /etc/rc.d scripts then finally runs rc.local at the end. Lots of things get started that are neither in rc.M or rc.local, such as rc.tomcat and rc.firewall, yet if I make them executable they get run. How? If something fails to run in /etc/rc.d, where is the failure logged? |
I don't know about rc.tomcat, but rc.firewall is run from rc.inet1, which is itself run from rc.M. Failures in startup scripts that make text be outputted to the console can generally be seen on screen. I think most of them are not recorded in any file unless you modify the scripts to output text to a file instead or in addition to the screen.
Edit: in addition, you could take a look at bootlogd and run it after mounting the root partition, modifying the init scripts. |
Follow the bread crumbs starting with /etc/inittab. From that file follow each listed rc.d file . As you noticed, some init scripts are called from other scripts that are called from the main scripts listed in inittab. There is no magic, just patience with browsing through each script. Knee bone is connected to thigh bone . . . .
|
Thanks! After "following breadcrumbs" it turns out there is no magic after all. rc.tomcat DOES NOT get automatically executed. Everything that gets run either gets run from rc.M, and additional think I want get run in rc.local ... if I put them in there. I thought there was something somewhere that when through the executable scripts in /etc/rc.d and ran them. I believe what I was thinking of was the "for profile_script in /etc/profile.d/*.sh" line in /etc/profile. /etc/rc.d doesn't work that way.
Mystery clear up! Thanks. |
bash it self runs /etc/profile when started as a login shell
|
Quote:
if [ -x /etc/rc.d/rc.tomcat ]; then /etc/rc.d/rc.tomcat start fi Quote:
|
Quote:
|
All times are GMT -5. The time now is 09:36 AM. |