How to Install a Startup Script in CentOS

This is appropriate for 99% of your daemons. Create a text file. Put these two lines at the top.

# chkconfig: 2345 90 10
# description: my_service - does this and that

Then add the command required to start the service.

/path/to/program

Save the file to my_service. Run the following commands.

mv my_service /etc/init.d
sudo /sbin/chkconfig --add my_service

If the chkconfig command is not found, first run this:

yum install chkconfig