LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-03-2009, 06:24 PM   #1
mfoley
Member
 
Registered: Oct 2008
Posts: 67

Rep: Reputation: 15
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?
 
Old 10-03-2009, 06:39 PM   #2
rg3
Member
 
Registered: Jul 2007
Distribution: Slackware Linux
Posts: 512

Rep: Reputation: Disabled
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.
 
Old 10-03-2009, 08:50 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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 . . . .
 
Old 10-04-2009, 12:43 AM   #4
mfoley
Member
 
Registered: Oct 2008
Posts: 67

Original Poster
Rep: Reputation: 15
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.
 
Old 10-04-2009, 09:48 AM   #5
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 788

Rep: Reputation: 112Reputation: 112
bash it self runs /etc/profile when started as a login shell

Last edited by rob.rice; 10-04-2009 at 10:17 AM.
 
Old 10-04-2009, 10:32 AM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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.
 
Old 10-04-2009, 11:10 AM   #7
GazL
Senior Member
 
Registered: May 2008
Posts: 3,425

Rep: Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937Reputation: 937
Quote:
Originally Posted by mfoley View Post
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kill scripts not being executed upon reboot druidmatrix Red Hat 9 02-17-2009 08:03 PM
RHEL3: init scripts aren't executed dabang Red Hat 2 01-04-2007 07:54 AM
VPN: Debian Scripts -> Mandriva 2006 Scripts Undefined Mandriva 0 11-30-2005 12:10 PM
How to get next executed line phuna Programming 2 07-08-2005 12:05 AM
.xinitrc isn't executed hampel Linux - Software 5 08-06-2003 03:53 AM


All times are GMT -5. The time now is 10:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration