LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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, 12:21 PM   #1
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,140

Rep: Reputation: 152Reputation: 152
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, 12:53 PM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,504

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
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 12:54 PM.
 
1 members found this post helpful.
Old 01-25-2014, 01:05 PM   #3
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,140

Original Poster
Rep: Reputation: 152Reputation: 152
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, 01:54 PM   #4
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,504

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
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 02:04 PM.
 
Old 01-25-2014, 02:15 PM   #5
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Ruhr Area, Germany
Distribution: Slackware64 14.0
Posts: 1,525

Rep: Reputation: 94
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, 02:47 PM   #6
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,140

Original Poster
Rep: Reputation: 152Reputation: 152
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


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


All times are GMT -5. The time now is 08:47 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration