For a service with an init script provided for CentOS, vonskippy's method of using
chkconfig is probably the best. A quick search shows that there are a number of init scripts for Teamspeak floating around there; I have no idea of their quality.
Another way of doing it is to have cron start the service. As an example, here's how you could automatically start your Teamspeak server.
First, change to the user account you want the server to run as ("teamspeak" in this case).
Code:
su - teamspeak
Then, unless you are familiar with vi, set an editor to use. Nano is pretty easy to get started with. (If it is not installed,
yum install nano will do so.)
Code:
export EDITOR=/usr/bin/nano
Now you can edit the crontab file.
Code:
crontab -e
Insert the following line.
Code:
@reboot /full/path/to/teamspeak/server/program > /dev/null 2>&1 &
Then save the file and exit the editor. Now you can exit your session as the teamspeak user.
Code:
exit
When your system is rebooted (actually, any time the cron daemon restarts), the Teamspeak server will be run.