Announcement

Collapse
No announcement yet.

rc.local not executing at boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    rc.local not executing at boot

    In my rc.local file I have the commands required to mount several nfs file systems on my machine. However they don't get executed when the system boots. Going to a terminal screen and executing sudo /etc/rc.local works. Permissions on rc.local are 755, and it is owned by root. This worked as expected in 8.10, but hasn't worked since installing 9.04. I can't find an error message in any of the logs. Any suggestions on how to get this going will be appreciated.

    Thanks for your time.

    #2
    Re: rc.local not executing at boot

    I don't think it works the same on Ubuntu as on Red Hat. The Community Ubuntu Documentation article RcLocalHowTo gives an equivalent way.

    Originally posted by RcLocalHowTo
    . . . in Redhat based distributions we can add our own scripts or programs into the /etc/rc.d/rc.local file, however there is no such file in a Debian based system.
    The suggested equivalent file is /etc/init.d/local. Read the article for more info. I'll be reading up a bit too.

    Edit: It looks like all the magic happens with the update-rc.d command.

    Originally posted by man update-rc.d
    DESCRIPTION
    update-rc.d updates the System V style init script links /etc/rcrun-
    level.d/NNname whose target is the script /etc/init.d/name. These
    links are run by init when it changes runlevels; they are generally
    used to start and stop system services such as daemons. runlevel is
    one of the runlevels supported by init, namely, 0123456789S, and NN is
    the two-digit sequence number that determines where in the sequence
    init will run the scripts.
    The same man page suggests to manually edit the links instead of using update-rc.d. Some deeper reading on Ubuntu's Init system will be required to understand why it is so.
    Welcome newbies!
    Verify the ISO
    Kubuntu's documentation

    Comment


      #3
      Re: rc.local not executing at boot

      Originally posted by Telengard
      I don't think it works the same on Ubuntu as on Red Hat.
      /etc/rc.local is run by default on ubuntu systems (though it does nothing by default). The init link that's responsible for running /etc/rc.local on the default runlevel is /etc/rc2.d/S99rc.local, which means it is run as root at the end of the boot process.

      You may check that etc/rc2.d/S99rc.local exists, but the likely cause for your issues is that /etc/rc.local is actually run (you can check this by adding a command like 'touch /var/log/rc.local_ran_succesfully' in your /etc/rc.local file, and such a file should be created during boot), but your network isn't up when /etc/rc.local is run.

      Haven't used NetworkManager in a while, but if you are, I remember it connects to the network after you login by default (and therefore after /etc/rc.local is executed).

      Comment


        #4
        Re: rc.local not executing at boot

        Thanks, Kubicle. I certainly got in over my head again
        Welcome newbies!
        Verify the ISO
        Kubuntu's documentation

        Comment


          #5
          Re: rc.local not executing at boot

          If you have NFS mounts in /etc/fstab they will be mounted at boot automatically unless you tell them not to. If you are running wicd this may not happen, but if you are using ifupdown or network-manager it should. If you network is wireless and you are using network manager the mounts should happen after you login and the network is brought up.

          Comment

          Working...
          X