Run scripts at system startup on Linux
Posted January 26th, 2009 in Linux/Unix/BSD (Updated March 20th, 2009)
This post looks at how to run additional scripts or applications at system startup / system boot up on Linux. I can confirm that this works on CentOS (and should therefore work on Red Hat Enterprise Linux from which is it derived, and Fedora and Fedora based distros) and Debian (and therefore on Debian derived distros).
After all the other processes are started by the init command at boot time, the following script is run on Red Hat / CentOS based systems:
/etc/rc.d/rc.local
And this script on Debian based systems:
/etc/rc.local
You can put your additional commands or scripts to run into this script with the knowledge that everything else has already started up, and doesn't require the complex initialisation scripts that appear in the /etc/rc.d/init.d or /etc/init.d directory.
Related posts:
- Run a cron command every 15 minutes (Thursday, October 30th 2008)
- Bash shell becomes inactive on Ctrl+S (Thursday, October 9th 2008)
- Sysmon init script (Sunday, October 5th 2008)
- Modifying the Linux Grub boot loader's options (Saturday, April 5th 2008)

Comments
blog comments powered by Disqus