Comment 3 for bug 882254

Revision history for this message
julien (julien-briche) wrote :

Hello,
I am quite a newbie in fixing bugs in Ubuntu, but as I deeply needed this feature I had to put my fingers in the mud...
So here is the new file /etc/init.d/rc.local I modified and it works, at least for what I meant to do (in fact the -x didn't worked so I put -e and I forced the execution of /etc/rc.local by adding sh in front ).

#! /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 [ -e /etc/rc.local ]; then

         [ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
  sh /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

hope it will help someone...