Using Services
Your server comes with init scripts for all of the core Rails Machine services. This includes Apache, MySQL, and Mongrel cluster. You can find these scripts and more in /etc/init.d/. They are all used similarly.
To start or stop a service, use the service command with the name of the script. Examples:
service httpd stop
service mysqld start
service mongrel_cluster restart
service <service_name> [start|stop|restart|status]
Note: If you are not running as root on the server, you will need to use sudo and the full path to service:
sudo /sbin/service mysqld restart
Startup scripts
Service can also be used to start services when the system boots. To add or remove startup services, or to view the current configuration use these commands:
chkconfig --list <service>
chkconfig <service> on #start the service on boot
chkconfig <service> off #do not start automatically
Hint: When you add a new init script, be sure to make it executable:
chmod +x /etc/init.d/<service>
