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 - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-18-2011, 03:45 AM   #1
carltse
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
Fedora 16 rc.local Problem


i isntall the fedora 16 but can't find the rc.local file

i create the rc.local in /etc/rc.d/

but the fedora start up can't run rc.local.

how to fix this problem.

Thx
 
Old 11-18-2011, 06:27 AM   #2
jayfree
Member
 
Registered: Oct 2009
Location: NJ
Distribution: fedora 20 and rawhide
Posts: 47

Rep: Reputation: 8
Make sure the first line is #! /bin/sh and the file is executable.
 
Old 11-18-2011, 11:59 PM   #3
carltse
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jayfree View Post
Make sure the first line is #! /bin/sh and the file is executable.
added #! /bin/sh
and set the chmod 755 still can't start up
 
Old 11-19-2011, 08:45 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I think Fedora wants the path to be /etc/rc.local, not /etc/rc.d/rc.local.

http://www.fedorafaq.org/basics/#startonboot
 
Old 11-20-2011, 12:04 PM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
On my Fedora 14, it's in /etc/rc.d/rc.local with a link from /etc/rc.local. But surely this is part of the Sys V init system? It might be ignored because Fedora 16 is using startd or whatever it's called.
 
Old 11-20-2011, 09:18 PM   #6
carltse
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
I test the rc.local can startup now

but the command can work

rc.local
----------------------------------------------------------------
#!/bin/sh

route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.1.254

date > test.txt
-----------------------------------------------------------------

the route add this line don't work
 
Old 11-20-2011, 09:31 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Thanks, David McCann. I heard that Fedora was playing with the init process in v. 16, but I haven't played with it yet.
 
Old 03-16-2012, 09:14 AM   #8
mikeaguilar
LQ Newbie
 
Registered: Jun 2010
Distribution: RHEL, Solaris 10, BSD, OSX
Posts: 2

Rep: Reputation: 0
Fedora 16---Here is a solution that I have used.

First, bear in mind that the rc.local script is not strictly a *nix rc type of service start up command. What I am saying here is that depending on the run-level, services should be started up under the rc.x directories. So, the solution I have used is to create a legitimate service under the /etc/init.d directory and to start the service automatically using chkconfig. For example, I wanted to customize my resolv.conf file. So, the solution went as follows:

I created a bash file called /etc/init.d/res:


#!/bin/bash
#
#chkconfig: 345 82 20
#description: alter resolv.conf
#
RETVAL=0

case "$1" in
"start")
# start daemon
echo "Altering the resolv.conf file"
RETVAL=$?
\cp -f /opt/resolv.conf /etc/resolv.conf
;;

*)
echo "Usage: $0 {start}"
exit 1
;;
esac


Next, I turned the bash program into a service:

# chmod +x /etc/init.d/res
# chkconfig --add res
# chkconfig --list | grep res
# chkconfig res on
# service res start

Finally, I verified the operation of the bash program, after the boot-up. Voila, fixed!

One more thing.....Fedora may be for "tinkering" as a Beta operating system, but, I would guess that some of the persons on this forum are supposed "IT guys". Please be aware that some of these frameworks were put in the original Unix System V OS.
 
Old 09-20-2012, 03:12 PM   #9
TarrasQ
LQ Newbie
 
Registered: Mar 2004
Location: Oulu, Finland
Distribution: F15
Posts: 23

Rep: Reputation: 0
Also this should work:

rc.local's place is /etc/rc.d/rc.local
rc.local should be executable (mode 755).

Create a symlink in /etc/systemd/system/multi-user.target.wants/ to tell Fedora to execute rc-local service (which executes rc.local):
ln -s /lib/systemd/system/rc-local.service /etc/systemd/system/multi-user.target.wants/rc-local.service


Check with systemctl status rc-local.service if rc-local has been executed on boot or resume.
 
  


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
Rc.local not woking in Fedora 10 gfem Fedora 7 01-20-2009 04:50 PM
No Internet Connection on Fedora - local ok VectorBoson2 Linux - Networking 2 09-08-2007 12:01 AM
rc.local in fedora core 3 alvi2 Linux - Networking 2 09-07-2005 11:51 PM
local server on Fedora Core 4 yayalasee Linux - Newbie 2 08-02-2005 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:51 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
Open Source Consulting | Domain Registration