Fedora Linux Support Community & Resources Center
  #1  
Old 9th November 2011, 06:24 PM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Fedora 16 rc.local problem

In previous installations of Fedora I've used /etc/rc.local to do various tasks, mostly creating SSH tunnels to other systems (database, LDAP, etc.). After upgrading to Fedora 16 from 15, I've run into a bit of trouble.

It seems rc.local was moved from /etc/rc.local to /etc/rc.d/rc.local and is now run through systemd, which checks to make sure the file is executable (the upgrade process moved the file and set it to executable). The script is run (I can tell because the `touch /var/lock/subsys/local` command updates the last modified timestamp on the file), but my SSH tunnels are not being created. If, however, I execute the file normally via:

Code:
# /etc/rc.d/rc.local
the tunnels are created without issue. Also running:

Code:
# systemctl status rc-local.service
gets me:

Code:
rc-local.service - /etc/rc.local Compatibility
     Loaded: loaded (/lib/systemd/system/rc-local.service; static)
     Active: failed since Wed, 09 Nov 2011 12:10:30 -600; 3min 56s ago
    Process: 934 ExecStart=/etc/rc.d/rc.local start (code=exited, status=255)
     CGroup: name=systemd: /system/rc-local.service
Now, if I start the service manually with:

Code:
# systemctl start rc-local.service
this also runs the script and creates the SSH tunnels without issue.

The command I'm using to create the tunnels is:

Code:
ssh -fNL 6360:127.0.0.1:6360 user@server1
I've already setup key-based authentication so root won't be prompted for the password for the 'user' account on server1 (I'm assuming systemd is running these services as root, is that not the case?). I've looked in /var/log/messages for SELinux notices (though I've set SELinux in permissive mode), and found nothing. I'm fairly stumped and this is a pretty big roadblock. Anyone have any ideas?
Reply With Quote
  #2  
Old 9th November 2011, 06:43 PM
jayfree Offline
Registered User
 
Join Date: Apr 2009
Location: East Brunswick, New Jersey
Posts: 78
linuxfirefox
Re: Fedora 16 rc.local problem

In previous versions /etc/rc.local was a symbolic link to /etc/rc.d/rc.local. Just create an /etc/rc.d/rc.local file and make it executable and it should work.
__________________
"Learn to swim"
Registered Linux User #301129
Reply With Quote
  #3  
Old 9th November 2011, 07:32 PM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Re: Fedora 16 rc.local problem

The file is there, and it is executable.
Reply With Quote
  #4  
Old 10th November 2011, 05:22 AM
Dans564 Offline
Registered User
 
Join Date: Aug 2010
Posts: 12
linuxchrome
Re: Fedora 16 rc.local problem

i think this is also effecting my ability to blacklist my amd gpu. I added:

modprobe radeon
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

to /etc/rc.d/rc.local but it didn't seem to work...

And solution would be highly appreciated
Reply With Quote
  #5  
Old 10th November 2011, 05:42 AM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,062
linuxfirefox
Re: Fedora 16 rc.local problem

Quote:
Originally Posted by Dans564 View Post
i think this is also effecting my ability to blacklist my amd gpu. I added:

modprobe radeon
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

to /etc/rc.d/rc.local but it didn't seem to work...

And solution would be highly appreciated

You said you made your /etc/rc.d/rc.local executable but did you also put
on the first line:
Quote:
#!/bin/sh
??
Reply With Quote
  #6  
Old 10th November 2011, 06:09 AM
Dans564 Offline
Registered User
 
Join Date: Aug 2010
Posts: 12
linuxchrome
Re: Fedora 16 rc.local problem

yea i did.
I have a feeling this has something to do with it. The output of "[dan@Fedora-16 ~]$ systemctl status rc-local.service" is:


rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; static)
Active: failed since Thu, 10 Nov 2011 01:06:01 -0500; 2min 23s ago
Process: 1051 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)
CGroup: name=systemd:/system/rc-local.service
Reply With Quote
  #7  
Old 11th November 2011, 05:15 PM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Re: Fedora 16 rc.local problem

Here's some interesting stuff, looking in /var/log/boot.log showed (where "server1" is an actual FQDN) I see:

Code:
ssh: Could not resolve hostname server1: Name or service not known
Weird, so I made an entry in /etc/hosts and tried it again. Now the entry in /var/log/boot.log is:

Code:
ssh: connec to host server1 port 22: Network is unreachable
Strange, so I changed my /etc/rc.d/rc.local file to include some debugging info:

Code:
#!/bin/sh

touch /var/lock/subsys/local
ifconfig >> /root/scripts/log
route >> /root/scripts/log
ping -c 4 >> /root/scripts/log
traceroute server1 >> /root/scripts/log
ssh -fNL 6360:127.0.0.1:6360 user@server1
Now, the /root/scripts/log file shows that when /etc/rc.d/rc.local is run, the network interface has the appropriate IP address bound to it, and a proper routing table entry exists for the subnet gateway. Traceroute is able to reach server1 just fine, but the ping command fails, saying 'Destination Host Unreachable'.

I am now officially baffled.

---------- Post added at 11:15 AM ---------- Previous post was at 11:05 AM ----------

Quote:
Originally Posted by Dans564 View Post
yea i did.
I have a feeling this has something to do with it. The output of "[dan@Fedora-16 ~]$ systemctl status rc-local.service" is:


rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; static)
Active: failed since Thu, 10 Nov 2011 01:06:01 -0500; 2min 23s ago
Process: 1051 ExecStart=/etc/rc.local start (code=exited, status=203/EXEC)
CGroup: name=systemd:/system/rc-local.service
The 'status=203/EXEC' is the exit code from modprobe (more specifically, the exit code from whatever command is causing the script to fail).

I tried a quick Google search but couldn't find what modprobe's exit code 203 specifies, did you look in /var/log/boot.log to see if there are any specific messages? You can use:

Code:
# cat /var/log/boot.log | grep -A 3 -B 3 'rc.local'

Last edited by forethought; 11th November 2011 at 05:08 PM.
Reply With Quote
  #8  
Old 11th November 2011, 06:20 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: Fedora 16 rc.local problem

first you have "ping -c 4 >> /root/scripts/log", but no host is specified.

the exit status should be from either the ping command (if it caused the script to terminate) or from ssh.

I'm not sure whether that exit code is octal or not but 203 is a really odd number for an exit code.

You might look in /etc/messages to see if a message got recorded.

the exit code is almost certainly from ssh - it uses 255 for various errors (could not resolve hostname), so I would expect something similar for others.

Last edited by jpollard; 11th November 2011 at 06:29 PM.
Reply With Quote
  #9  
Old 11th November 2011, 07:38 PM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Re: Fedora 16 rc.local problem

Quote:
Originally Posted by jpollard View Post
first you have "ping -c 4 >> /root/scripts/log", but no host is specified.

the exit status should be from either the ping command (if it caused the script to terminate) or from ssh.

I'm not sure whether that exit code is octal or not but 203 is a really odd number for an exit code.

You might look in /etc/messages to see if a message got recorded.

the exit code is almost certainly from ssh - it uses 255 for various errors (could not resolve hostname), so I would expect something similar for others.
My mistake, the contents of the /etc/rc.d/rc.local file are actually:

Code:
#!/bin/sh

touch /var/lock/subsys/local
ifconfig >> /root/scripts/log
route >> /root/scripts/log
ping -c 4 server1 >> /root/scripts/log
traceroute server1 >> /root/scripts/log
ssh -fNL 6360:127.0.0.1:6360 user@server1
I just got sloppy with entering it here.

There's nothing in /var/log/messages that I can see that would indicate what's going on, even in there I see the network interface brought up before systemd runs rc-local.service.
Reply With Quote
  #10  
Old 11th November 2011, 10:45 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: Fedora 16 rc.local problem

I suspected that was a typo.

Something isn't finished with the network, but right off hand I'm not sure what.

One thing you could check is to use "netstat -rn" in place of the route command. This should show the status of all networks, gateways, and possibly any transmission errors.

And try this after the ping command since it is what fails first.
Reply With Quote
  #11  
Old 12th November 2011, 12:50 AM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Re: Fedora 16 rc.local problem

Output of the netstat command:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.30.100  0.0.0.0         UG        0 0          0 em2
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 em2
192.168.30.0    0.0.0.0         255.255.255.0   U         0 0          0 em2
Still, got no clue
Reply With Quote
  #12  
Old 12th November 2011, 12:08 PM
NSLW Offline
Registered User
 
Join Date: Jun 2009
Posts: 23
linuxfirefox
Re: Fedora 16 rc.local problem

This should be relevant info.
Reply With Quote
  #13  
Old 14th November 2011, 08:24 PM
forethought Offline
Registered User
 
Join Date: Feb 2009
Posts: 17
linuxfirefox
Re: Fedora 16 rc.local problem

Quote:
Originally Posted by NSLW View Post
This should be relevant info.
All I see from that link is saying /etc/rc.d/rc.local is not included by default, and that it is run through systemd.

The issue is that networking isn't working correctly when commands in rc.local are run; I don't see anything in that link that would allude to what the underlying problem would be.
Reply With Quote
  #14  
Old 15th November 2011, 09:48 AM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,865
linuxfedorafirefox
Re: Fedora 16 rc.local problem

I guess the only thing left is to make a bugzilla entry. It really should be working.
Reply With Quote
  #15  
Old 15th November 2011, 10:00 AM
auroraflame Offline
Registered User
 
Join Date: Aug 2011
Posts: 20
linuxfirefox
Re: Fedora 16 rc.local problem

well, i am not alone

looks like it got to do with the rc-local.service
Code:
$ cat /lib/systemd/system/rc-local.service 
---------%cut%------------
[Service]
Type=forking
ExecStart=/etc/rc.d/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
maybe editing /etc/rc.d/rc.local to receive 'start' arguments will help
CMIIW
Reply With Quote
Reply

Tags
fedora, problem, rclocal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
halt.local / rc.local.shutdown for Fedora? flansuse Using Fedora 4 10th December 2010 10:40 AM
local ip problem Marko89 Servers & Networking 1 25th September 2008 05:31 PM
How to block all local IP and allow certain local IP using IPTABLES to connect inet? laluvirtual Security and Privacy 5 29th June 2007 01:07 PM


Current GMT-time: 03:12 (Wednesday, 22-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Ramos Arizpe - Kortrijk Travel Photos - Cordoba