Bash – Why isn’t the shell script executing on startup

bashbootopensuserc.d

I'd like my openSuse 11.1 server to run a small shell script on startup. I've created a the script and put a symbolic link to the script in /etc/init.d/rc5.d/. Yet, the script does not get executed.

This is the script I am trying to run:

#!/bin/bash
#monitor RAID array
/sbin/mdadm --monitor --daemonize --mail=adrian@linuxplug.fli4l /dev/md0 /dev/md1 /dev/md2 /dev/md3
#start SVN server
/usr/bin/svnserve -d

The script works fine when I run it myself from the command line (svn server and mdadm are daemonized as expected). But it does not seem to be started when rebooting the server.

This might help you figure out what I am doing wrong:

linuxplug:~ # ls -l /etc/init.d/rc5.d/exe*
lrwxrwxrwx 1 root root 25 May 22 11:43 /etc/init.d/rc5.d/executeatstartup.sh -> /root/executeatstartup.sh
linuxplug:~ # ls -l /root/executeatstartup.sh
-rwxr-xr-x 1 root root 172 Apr 12 13:43 /root/executeatstartup.sh
linuxplug:~ # which svnserve
/usr/bin/svnserve

What am I doing wrong?

Edit: I've renamed the link to the shell script as follows:

linuxplug:~ # ls -l /etc/init.d/rc5.d/    
lrwxrwxrwx 1 root root 25 May 22 12:03 S99executeatstartup -> /root/executeatsta
    rtup.sh

However, the script still isn't run on startup.

Best Answer

Have you tried adding a call to the script in your /etc/init.d/boot.local? Try it and see if that works better. There are several other boot.* files that are run at different parts of the startup.