How to run a script on boot for SUSE Enterprise Server 11

sles

I've added the following and confirmed the script works as it is by first running it. Why isn't this script then running when the server starts up each time? Not sure what I'm missing.

Confirmed working sh myscript.sh

file is in /etc/init.d/myscript.sh

Best Answer

/etc/init.d/ doesn't mean "always-start-everything-inside". There're /etc/rcN.d/ directories which define subsets of /etc/init.d/ for each possible system "run-level". Try man chkconfig — at least on RedHat's derivatives it explains the system. I suppose SuSe should have one too.

P. S. Also, for some trivial init-scripts, which need not to have dependencies info and so on, /etc/rc.local can be used instead. It's a bit ugly but sometimes KISS principle overrides this by its own beauty. ;-)