Ubuntu init.d script not being called on startup

Posted by Mike on Super User See other posts from Super User or by Mike
Published on 2010-10-29T00:10:42Z Indexed on 2011/01/16 4:55 UTC
Read the original article Hit count: 342

Filed under:
|
|

I've got a script in ubuntu 9.04 in init.d that I've set to run on start on with update-rc.d using update-rc.d init_test defaults 99. All of the symlinks are there and the permissions appear to be correct

-rwxr-xr-x  1 root root   642 2010-10-28 16:44 init_test

mike@xxxxxxxxxx:~$ find /etc -name S99* | grep init_test
find: /etc/rc5.d/S99init_test
find: /etc/rc4.d/S99init_test
find: /etc/rc2.d/S99init_test
find: /etc/rc3.d/S99init_test

The script runs through source and ./ without issue and behaves correctly. Here is the source of the script:

#!/bin/bash
### BEGIN INIT INFO
# Provides:          init test script
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

start() {
    echo "hi"
    echo "start called" >> /tmp/test.log
    return
}

stop() {
    echo "Stopping"
}

echo "Script called" >> /tmp/test.log

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    *)
        echo "Usage:  {start|stop|restart}"
        exit 1
        ;;
esac
exit $?

When the machine starts, I don't see "script called" or "start called" in the test.log at all. Is there anything obvious I'm messing up?

© Super User or respective owner

Related posts about linux

Related posts about ubuntu