LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-25-2014, 11:21 AM   #1
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
To make scripts running at boot


What is the difference between using:
chmod +x /etc/rc.d/rc.local
Or:
/etc/rc.d/rc.local enable

?
 
Old 01-25-2014, 11:53 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Quote:
Originally Posted by moisespedro View Post
What is the difference between using:
chmod +x /etc/rc.d/rc.local
Or:
/etc/rc.d/rc.local enable

?
the first command doesn't do anything because /etc/rc.d/rc.local (the last script to be executed at boot) is already executable.

the second just executes rc.local: it doesn't know about an "enable" parameter because by default it's empty, it doesn't contain something (commands, function, etc.) to execute when passed that string.

if you want to execute an executable /etc/rc.d/rc.whatever at boot you have to add an if..then like this inside /etc/rc.d/rc.local
Code:
# Starting the whatever daemon
if [ -x /etc/rc.d/rc.whatever ]; then
  /etc/rc.d/rc.whatever start
fi
(obviously the rc.whatever must be an init script - for an example you can see rc.clamav)
ad if you want the "whatever" daemon to stop at shutdown, you have to add something similar to /etc/rc.d/rc.local_shutdown
Code:
# Stopping the whatever daemon
if [ -x /etc/rc.d/rc.whatever ]; then
  /etc/rc.d/rc.whatever stop
fi

Last edited by ponce; 01-25-2014 at 11:54 AM.
 
1 members found this post helpful.
Old 01-25-2014, 12:05 PM   #3
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
I am still confused, a tutorial "said" to "chmod +x" to make it executable and to run at boot. Then, I've put "unicode_start" on it. I've run "/etc/rc.d/rc.local enable" and it looks like it worked.
 
Old 01-25-2014, 12:54 PM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Quote:
Originally Posted by moisespedro View Post
I am still confused, a tutorial "said" to "chmod +x" to make it executable and to run at boot.
which tutorial?
the only /etc/rc.d/rc.* scripts that are executed at boot just if you make them executable are the ones which are called from the ones that bring up the system (with an if..then condition like the one above), see /etc/rc.d/rc.M and /etc/rc.d/rc.inet2 for examples.
Quote:
Then, I've put "unicode_start" on it. I've run "/etc/rc.d/rc.local enable" and it looks like it worked.
sorry, I cannot understand what you're talking about.

Last edited by ponce; 01-25-2014 at 01:04 PM.
 
Old 01-25-2014, 01:15 PM   #5
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,645

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by moisespedro View Post
I am still confused, a tutorial "said" to "chmod +x" to make it executable and to run at boot. Then, I've put "unicode_start" on it. I've run "/etc/rc.d/rc.local enable" and it looks like it worked.
Since /etc/rc.d/rc.local is executable, of course it will get executed if you call it. You should be able to give it any parameter (supposed you have no lines in it that take the parameter as command). So even calling it "/etc/rc.d/rc.local disable" or "/etc/rc.d/rc.local monkey" should work. "disable", "enable" or "monkey" will have no effect here.
 
Old 01-25-2014, 01:47 PM   #6
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Original Poster
Rep: Reputation: 195Reputation: 195
Oh, I see. Now I've got it. "unicode_start" was just a command to set UTF properly, according to the tutorial.
Thanks guys.
 
  


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
scripts not running at boot Hyakutake Slackware 7 07-31-2007 06:50 AM
Running network scripts on boot Brynn Linux - Wireless Networking 6 11-08-2006 09:39 AM
running scripts at boot dglock Linux - General 3 08-15-2006 01:15 PM
running scripts at boot... thedp SUSE / openSUSE 2 10-17-2005 08:21 AM
running scripts at boot viniosity Ubuntu 3 07-19-2005 08:52 PM

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

All times are GMT -5. The time now is 11:00 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