Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script on ubuntu that I put in /etc/init.d. It has 0755 permissions, and I can run it manually both executing it and sourcing it, with good results. I have symlinks in both /etc/rc3.d and /etc/rc5.d, both named S01raid, both pointing to the init.d script. When I reboot the machine however, the script doesn't seem to run. I dont see the array mounted or even running, nor do I see the monitor daemon running on the ps -A output

What am I missing here?

script contents:

#!/bin/sh -e
modprobe raid5
mdadm --assemble --scan
mdadm --monitor --scan --daemonize --delay 120 --program /etc/mdadm/
mount -t xfs /dev/md0 /mnt/
share|improve this question
up vote 2 down vote accepted

I'd suggest you follow the standard tools to run a script at startup.

Look at this answer to a similar question, where I listed down the steps to follow. Also, as mentioned by another user on that question, for testing purposes I'd just place the commands in /etc/rc.local, before the "exit 0".

You also need to ensure any services this depends on are already started when this is run. Check the logs in /var/log for any error messages.

share|improve this answer

"S01" means it runs pretty early in the boot process. First thing I'd do is make sure that there aren't things that need to run first that are later (have higher numbers).

On my Ubuntu system, sysklogd is S10 and mdadm is S25, so at least make it higher than those so you can see if it logs anything.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .