Results 1 to 6 of 6

Thread: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

  1. #1
    Join Date
    Mar 2013
    Beans
    11

    Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    I recently had an external enclosure go down. I was on Ubuntu 12.04 and I had "sudo zfs mount $poolname" in /etc/rc.local, which automounted the pool at startup.
    As part of attempts to troubleshoot, I upgraded to 12.10. Now, with a working enclosure. I no longer get automounting on startup. If I open a terminal after startup and copy-paste from rc.local, the zfs pool mounts just fine, but somewhere during startup this command must be failing. How can I find out what's going on?
    Last edited by VanderveckenSmith; April 8th, 2013 at 12:43 AM.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    11,866
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    There should be a symlink to /etc/init.d/rc.local in /etc/rc2.d called S99rc.local. Is it there? /etc/init.d/rc.local invokes /etc/rc.local like this:
    Code:
    # more /etc/init.d/rc.local
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          rc.local
    # Required-Start:    $remote_fs $syslog $all
    # Required-Stop:
    # Default-Start:     2 3 4 5
    # Default-Stop:
    # Short-Description: Run /etc/rc.local if it exist
    ### END INIT INFO
    
    
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    
    . /lib/init/vars.sh
    . /lib/lsb/init-functions
    
    do_start() {
            if [ -x /etc/rc.local ]; then
                    [ "$VERBOSE" != no ] && log_begin_msg "Running local boot script
    s (/etc/rc.local)"
                    /etc/rc.local
                    ES=$?
                    [ "$VERBOSE" != no ] && log_end_msg $ES
                    return $ES
            fi
    }
    
    case "$1" in
        start)
            do_start
            ;;
        restart|reload|force-reload)
            echo "Error: argument '$1' not supported" >&2
            exit 3
            ;;
        stop)
            ;;
        *)
            echo "Usage: $0 start|stop" >&2
            exit 3
            ;;
    esac
    Last edited by SeijiSensei; April 8th, 2013 at 12:03 AM.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Mar 2013
    Beans
    11

    Re: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    The symlink is present, and the contents of /etc/init.d/rc.local contain the section you pasted.

  4. #4
    Join Date
    Jan 2011
    Beans
    193

    Re: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    Are you sure rc.local is executable ?

    Add some logging line to see if it is run anyway. Maybe it is run but something else went wrong.
    Have you checked your /var/log already?

  5. #5
    Join Date
    Mar 2013
    Beans
    11

    Re: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    It is executable. Where in /var/log will I find the logging from rc.local?

  6. #6
    Join Date
    Mar 2013
    Beans
    11

    Re: Is /etc/rc.local not executing for me on startup (Ubuntu 12.10)?

    I checked in boot.log. It could not find /dev/zfs (even though t's there when I check after startup) and recommended I run sudo modprobe zfs, which I added to rc.local, and now it works. Thanks!

Bookmarks

Posting Permissions

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