LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2007, 12:43 AM   #1
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Rep: Reputation: 15
rc.local not executing


I must be missing something simple here, but it seems as if my rc.local is not executing. I am running Fedora Core 6.

[localhost]$ ls -l /etc/rc.d/rc.local
-rwxr-xr-x 1 root root 501 Sep 5 21:24 /etc/rc.d/rc.local

Last 3 lines of rc5.d:

lrwxrwxrwx 1 root root 19 Feb 18 2007 S99firstboot -> ../init.d/firstboot
lrwxrwxrwx 1 root root 11 Feb 18 2007 S99local -> ../rc.local
lrwxrwxrwx 1 root root 16 Feb 18 2007 S99smartd -> ../init.d/smartd

Is there any way to verify that it actually ran? Fedora starts to show all it's services in a GUI screen saying either [OK] or [FAILED] so even if I add an echo statement I cannot see the output (either that or its just not running). Any ideas here on what is going on?
 
Old 09-06-2007, 01:47 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
You seem confused.

1. /etc/rc.d/rc.local is a shell file to which you can add extra cmds you want to run at start-up, if an equiv is not already avail in the relevant rcX.d dir.

2. rc5.d is a dir, not a file. It's contents ie various shell files (actually via symlinks) are run if the system is started up in the initdefault=5 mode ie multi-user with X-windows.

3. If you want to check whether rc.local is being called correctly, add an extra line at the bottom of the file to eg touch a file in your home dir. Note that rc.local will be run as the root user.

HTH
 
Old 09-06-2007, 01:46 PM   #3
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Original Poster
Rep: Reputation: 15
I'm not confused, but what I posted was misleading.

"Last 3 lines of rc5.d:" should have read

Last 3 lines of:
[localhost ]$ ls -l /etc/rc.d/rc5.d

Quote:
3. If you want to check whether rc.local is being called correctly, add an extra line at the bottom of the file to eg touch a file in your home dir. Note that rc.local will be run as the root user.
Before I posted I tried adding "touch testfile.txt" to rc.local And no file was ever created in /etc/rc.d/. Since rc.local is being run as root this should have created a file somewhere, with no permissions to get in the way, right?

Am I correct in thinking that root runs init, which in turn runs all the startup scripts? If this is the case I would expect "touch testfile.txt" to have worked and put the file in the current working directory. Would this be /sbin/ since this is where init resides? Maybe it did work and I just dont know where to look for it.

When I get home I'll try doing "touch /home/username/testfile.txt" and see what that does.

I'll also try using find to look for the acutal file.
 
Old 09-08-2007, 10:47 AM   #4
mjl3434
Member
 
Registered: Sep 2003
Location: Los Angeles, CA
Distribution: Fedora 8
Posts: 108

Original Poster
Rep: Reputation: 15
Now working.

I got it working. Thanks for the help. Don't think there was anything wrong just a mistake in my script so even though it was being called, nothing was happening.
 
  


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
how can i add a local Folder on local Hard Disk as Yum Repository ?? vahid_p Fedora 4 02-22-2007 10:43 AM
shell script to compare filese b/w local and remote and delete files from local serve dsids Linux - Networking 9 08-23-2006 07:20 AM
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
How to get local gcc to link with local glibc dombrowsky Linux - Software 9 01-20-2006 02:01 PM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration