Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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'm trying to load a program I wrote at boot. The program is also a module.ko and a small bash script. For the module I tried doing depmod mymodule.ko and modprobe -a and messing around with modprob libaries and .conf files without any success.

So, I wrapped it all (module and my executed program) in a bash script. I tried to load it at boot with rc.d. I failed this one too cause I think rc.d runs only executed files and not bash. If I'm right how do I change my bash file to an executed one? And install it in rc.d too? Is my strategy right?

Thank you all in advance :)

*working on Linux CentOS

share|improve this question
There are parts of your question I don't understand. Your basic strategy is right, but obviously you didn't implement it correctly, and your description is too vague to understand what you did wrong. Try posting the exact commands you tried and any error message you got (use copy-paste). – Gilles Feb 13 '11 at 15:41

For your module, normally you'd normally put that in /etc/modprobe.conf but you can also put it in /etc/rc.modules.

For your script, if you want to just execute it once when the server boots, it can be put in /etc/rc.d/rc.local (although it is also executed when changing run levels). If you're looking for a more complex service you can start and stop or run at various run levels, you want a System V Init script

share|improve this answer
thanks... first start with the module how do I do it exactly in modprobe.conf , I wortel "alias name mymodulename" whats the meaning of doing soo? where do I need toput my .ko file? – azulay7 Feb 19 '11 at 9:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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