Fedora 16 rc.local problem
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 43
  1. #1
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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?

  2. #2
    Join Date
    Apr 2009
    Location
    East Brunswick, New Jersey
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  3. #3
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    The file is there, and it is executable.

  4. #4
    Join Date
    Aug 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  5. #5
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,747
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    Quote Originally Posted by Dans564
    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:
    #!/bin/sh
    ??

  6. #6
    Join Date
    Aug 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  7. #7
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    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 06:08 PM.

  8. #8
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 07:29 PM.

  9. #9
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    Quote Originally Posted by jpollard
    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.

  10. #10
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

  11. #11
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  12. #12
    Join Date
    Jun 2009
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    This should be relevant info.

  13. #13
    Join Date
    Feb 2009
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    Quote Originally Posted by NSLW
    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.

  14. #14
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fedora 16 rc.local problem

    I guess the only thing left is to make a bugzilla entry. It really should be working.

  15. #15
    Join Date
    Aug 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. halt.local / rc.local.shutdown for Fedora?
    By flansuse in forum Using Fedora
    Replies: 4
    Last Post: 10th December 2010, 11:40 AM
  2. local ip problem
    By Marko89 in forum Servers & Networking
    Replies: 1
    Last Post: 25th September 2008, 05:31 PM
  3. Replies: 5
    Last Post: 29th June 2007, 01:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •