LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-18-2006, 03:45 PM   #1
splyt
LQ Newbie
 
Registered: Sep 2006
Location: Brazil
Distribution: slackware
Posts: 13

Rep: Reputation: 0
Red face How the rc.d directory should be used?


Hello folks!
Please see if you can clarify a basic question.
I've read a lot about slackware and done some basic configurations too. If I for example want make mysql start automatically in slackware I just have to make the rc.mysqld executable and the next time slackware boots it will run the rc.mysqld script. So I am assuming that every executable script located in the /etc/rc.d directory will be executed with the start statement when the slackware boots. Am I right? If so then what is the rc.local script used for? I mean I don't need to open rc.local and put there a instruction like "/etc/rc.d/rc.mysqld start", I just need to make the rc.mysqld executable and put it on /etc/rc.d directory. So can someone just provide me a example to ilustrate a use of the /etc/rc.d/rc.local script?
Thanks
 
Old 09-18-2006, 04:12 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
So I am assuming that every executable script located in the /etc/rc.d directory will be executed with the start statement when the slackware boots. Am I right?
You're wrong.
The rc scripts that come with Slackware (like rc.mysqld, rc.alsa) are called from one of the other rc scripts. If you add your own rc file to /etc/rc.d/ you will have to add a couple of lines to rc.local that will start your program. Look in rc.M for inspiration. Generally it would look like this (example for an imaginary rc.ntp script):
Code:
# Set correct  time and date, and start the ntp daemon:
if [ -x /etc/rc.d/rc.ntp ]; then
  /etc/rc.d/rc.ntp start
fi
So, by making the script executable you will cause it to be started when the computer starts. The rc.local file will be run after all the other rc scripts have run.

Eric
 
Old 09-18-2006, 04:13 PM   #3
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 31
The mysqld script along with the other chmod +x files run because they get called from the high level boot scripts, like rc.M, rc.S.

If you add your own rc.whatever into the directory you need to modify one of those scripts or put the call to it in rc.local which is what that file is for.
 
Old 09-18-2006, 04:21 PM   #4
urka58
Member
 
Registered: Nov 2003
Distribution: slackware 15
Posts: 546

Rep: Reputation: 43
Yes, when you want a service to be started, just make the script executable. There are some exceptions, ie rc.hpoj (multifunction printers and rc.firewall, for which you must create a script from scratches. rc.local should be used whenever you need to start a service or a config tool not included in the distibution. One case could be some tuning of ide disk (hadparm) parameters or a daemon you want to start at boot time ( ie ifplugd for the network connection). As rc.local is run as last it is usually safe to put your own config tools there.
Ciao
 
Old 09-19-2006, 09:40 AM   #5
splyt
LQ Newbie
 
Registered: Sep 2006
Location: Brazil
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks very much for helping folks.
 
  


Reply



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
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM
Autozipping files from 1 directory & dropping them in other directory ??? amitsharma_26 Linux - Networking 5 10-22-2005 06:09 AM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 06:54 PM
Automatically Copying files from the ftp directory into the html directory swatward Linux - General 3 04-17-2005 10:55 PM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration