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


/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. ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.