How to run a script at system startup?
I have a script file (for starting a service) that I would like the system to run when it boots. What should I do to achieve that?
My Linux box is Debian Sarge. Thank you! |
Here's my notes on using my firewall script for Debian based systems like Knoppix or Feather:
Save the firewall script as /etc/init.d/firewall. Important: Set the permissions for root to read, write and exec. Also, read and exec for group and others. Something like chmod 755 /etc/init.d/firewall aught to do it. Type: update-rc.d firewall defaults 99 |
Thanks horney! It works!
|
You're welcome! :)
|
If this is a service that you want to always be running, i.e., if it dies or you inadvertantly kill it, you want it automatically restarted, investigate starting it in /etc/inittab using "respawn". inittab is generally used to start system level things, but you can certainly use it for your own higher level stuff if it fits your needs.
Example: I run MythTV and I always want the backend to be running: So in my /etc/inittab: Code:
# MythTV Backend |
All times are GMT -5. The time now is 07:04 PM. |