How can I configure my CentOS 5.5 to autostart some applications after rebooting?
I want to start nginx, mysqld and call some commands like rvm use ree
.
1 Answer
CentOS uses chkconfig to manage its startup scripts.
Type chkconfig --list
to view the services that are configured to work with checkconfig, and their settings.
MySQL should already be in that list.
If it isn't already configured to be on at runlevel 3 (the default runlevel for centos servers), run chkconfig mysqld on
You could write your own startup script to work with chkconfig for Nginx. Then you'll be able to manage it the same way as MySQL.
To make the system run custom commands at startup, you can add them to the /etc/rc.local
file.
- More information on how to use the chkconfig and service commands.
- An example of a custom init script for chkconfig.
-
Since you mentioned RVM, REE, im presuming that you are going to install nginx for Passenger. There is an Nginx startup script at articles.slicehost.com/2009/2/2/… Mar 11, 2012 at 17:50