Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-03-2009, 06:24 PM
|
#1
|
|
Member
Registered: Oct 2008
Posts: 52
Rep:
|
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?
|
|
|
|
10-03-2009, 06:39 PM
|
#2
|
|
Member
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 484
Rep: 
|
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.
Last edited by rg3; 10-03-2009 at 06:46 PM.
|
|
|
|
10-03-2009, 08:50 PM
|
#3
|
|
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 2,961
|
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 . . . .
|
|
|
|
10-04-2009, 12:43 AM
|
#4
|
|
Member
Registered: Oct 2008
Posts: 52
Original Poster
Rep:
|
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.
|
|
|
|
10-04-2009, 09:48 AM
|
#5
|
|
Member
Registered: Apr 2004
Distribution: slack what ever
Posts: 707
Rep:
|
bash it self runs /etc/profile when started as a login shell
Last edited by rob.rice; 10-04-2009 at 10:17 AM.
|
|
|
|
10-04-2009, 10:32 AM
|
#6
|
|
Senior Member
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 2,961
|
Quote:
|
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.
|
That is the basic idea. Any packages you add beyond the stock distribution that need a startup script generally are placed in rc.local. The general template looks like this:
if [ -x /etc/rc.d/rc.tomcat ]; then
/etc/rc.d/rc.tomcat start
fi
Quote:
|
I thought there was something somewhere that when through the executable scripts in /etc/rc.d and ran them.
|
If I recall correctly, the Zenwalk people do something like. You could look at their rc.d scripts and copy the general idea to your Slackware scripts.
|
|
|
|
10-04-2009, 11:10 AM
|
#7
|
|
Senior Member
Registered: May 2008
Posts: 2,843
|
Quote:
Originally Posted by mfoley
I thought there was something somewhere that when through the executable scripts in /etc/rc.d and ran them.
|
You're probably thinking of the sysv style init, which slackware supports but doesn't use for subsystem startup. Have a look at /etc/rc.d/rc.sysvinit if you're interested (or google sysvinit).
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:46 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|