Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Oct 29, 2011 7:50 pm 
Offline
Junior Member

Joined: Mon Oct 17, 2011 10:01 pm
Posts: 27
Hi, how can I make a program auto start when my server reboots?


Top
   
 Post subject:
PostPosted: Sun Oct 30, 2011 3:34 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What distro are you using and what program?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sun Oct 30, 2011 8:45 pm 
Offline
Junior Member

Joined: Mon Oct 17, 2011 10:01 pm
Posts: 27
I'm using CentOS 5 , I wanted to make my apache run when system reboots.


Top
   
 Post subject:
PostPosted: Sun Oct 30, 2011 9:22 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
#chkconfig httpd on

#chkconfig --list httpd


Top
   
 Post subject:
PostPosted: Sun Nov 06, 2011 8:52 pm 
Offline
Junior Member

Joined: Mon Oct 17, 2011 10:01 pm
Posts: 27
I'm sorry to bump this thread again, but I still don't know how to autorun a program when it restarts, I want my TeamSpeak or other programs to go up when server restarts. How can I do that?


Top
   
 Post subject:
PostPosted: Tue Nov 08, 2011 2:08 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group