/etc/rc.local not being run on Ubuntu Desktop Install

Posted by loosecannon on Server Fault See other posts from Server Fault or by loosecannon
Published on 2011-05-15T20:58:29Z Indexed on 2012/06/04 22:42 UTC
Read the original article Hit count: 717

Filed under:
|
|
|
|

I have been trying to get sphinx to run at boot, so I added some lines to /etc/rc.local but nothing happens when I start up. If i run it manually it works however.

/etc/init.d/rc.local start works fine as does /etc/rc.local

It's listed in the default runlevel and is all executable but it does not work.

I am considering writing a separate init.d script to do the same thing but that's a lot of work for a simple task

dumbledore:/etc/init.d# ls -l rc*
-rwxr-xr-x 1 root root 8863 2009-09-07 13:58 rc
-rwxr-xr-x 1 root root  801 2009-09-07 13:58 rc.local
-rwxr-xr-x 1 root root  117 2009-09-07 13:58 rcS

dumbledore:/etc/init.d# ls /etc/rc.local  -l
-rwxr-xr-x 1 root root 491 2011-05-14 16:13 /etc/rc.local

dumbledore:/etc/init.d# runlevel
N 2

dumbledore:/etc/init.d# ls /etc/rc2.d/ -l
total 4
lrwxrwxrwx 1 root root  18 2011-04-22 18:53 K08vmware -> /etc/init.d/vmware
-rw-r--r-- 1 root root 677 2011-03-28 15:10 README
lrwxrwxrwx 1 root root  18 2011-04-22 18:53 S19vmware -> /etc/init.d/vmware
lrwxrwxrwx 1 root root  18 2011-05-15 14:09 S20ddclient -> ../init.d/ddclient
lrwxrwxrwx 1 root root  20 2011-03-10 18:00 S20fancontrol -> ../init.d/fancontrol
lrwxrwxrwx 1 root root  20 2011-03-10 18:00 S20kerneloops -> ../init.d/kerneloops
lrwxrwxrwx 1 root root  27 2011-03-10 18:00 S20speech-dispatcher -> ../init.d/speech-dispatcher
lrwxrwxrwx 1 root root  19 2011-03-10 18:00 S25bluetooth -> ../init.d/bluetooth
lrwxrwxrwx 1 root root  20 2011-03-10 18:00 S50pulseaudio -> ../init.d/pulseaudio
lrwxrwxrwx 1 root root  15 2011-03-10 18:00 S50rsync -> ../init.d/rsync
lrwxrwxrwx 1 root root  15 2011-03-10 18:00 S50saned -> ../init.d/saned
lrwxrwxrwx 1 root root  19 2011-03-10 18:00 S70dns-clean -> ../init.d/dns-clean
lrwxrwxrwx 1 root root  18 2011-03-10 18:00 S70pppd-dns -> ../init.d/pppd-dns
lrwxrwxrwx 1 root root  14 2011-05-07 11:22 S75sudo -> ../init.d/sudo
lrwxrwxrwx 1 root root  24 2011-03-10 18:00 S90binfmt-support -> ../init.d/binfmt-support
lrwxrwxrwx 1 root root  17 2011-05-12 21:18 S91apache2 -> ../init.d/apache2
lrwxrwxrwx 1 root root  22 2011-03-10 18:00 S99acpi-support -> ../init.d/acpi-support
lrwxrwxrwx 1 root root  21 2011-03-10 18:00 S99grub-common -> ../init.d/grub-common
lrwxrwxrwx 1 root root  18 2011-03-10 18:00 S99ondemand -> ../init.d/ondemand
lrwxrwxrwx 1 root root  18 2011-03-10 18:00 S99rc.local -> ../init.d/rc.local

dumbledore:/etc/init.d# cat /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Start sphinx daemon for rails app on startup
# Added 2011-05-13
# Cannon Matthews
cd /var/www/extemp
/usr/bin/rake ts:config
/usr/bin/rake ts:start
touch ./tmp/ohyeah
cd -

exit 0

dumbledore:/etc/init.d# cat /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 scripts (/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

© Server Fault or respective owner

Related posts about ubuntu

Related posts about startup