Results 1 to 7 of 7
-
21-12-2009, 01:09 #1
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- London, UK
- Posts
- 10
Starting the server automatically
I used to run TS2 server on Linux previously, and I had a bash script that would detect whether or not TS was running and start it if it wasn't. This would be added to a crontab to be run automatically.
Now TS3 is out, and there's a Mac version of the server (huzzah!!) has anyone written any scripts to start it automatically? It doesn't necessarily have to be a Mac specific script, I might be able to modify a Linux bash script.
I tried modifying the old TS2 startup script, but I don't know much bash, and TS3 server doesn't use PID files, which was the way the old script detected if the server was running or not...
I think if I knew how to accurately and reliably detect if a binary is running on OS X then I could probably hack something together.
But like I said, my bash skills are less than desirable, so maybe someone else would have more luck.
-
21-12-2009, 03:16 #2
-= TeamSpeak User =-
- Join Date
- Mar 2009
- Location
- USA
- Posts
- 23
To my knowledge everything in this bash script works on mac as well as linux. This is the bash script I use for my teamspeak 3 server.
make sure you change the DIR to the right location, the DAEMON to the correct file, and the PARAMS to anything you want to specify on commandline to it
Code:#! /bin/sh # Leave this alone. NAME=teamspeak3_server PATH=/bin:/usr/bin:/sbin:/usr/sbin # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS! DIR=/home/teamspeak_server # Change this to the file for your system. DAEMON=ts3server_linux_x86 # Internet-server: PARAMS="inifile=ts3server.ini" # Leave this alone. DESC="Teamspeak server" case "$1" in start) ps aux | grep -v grep | grep "SCREEN -A -d -m -S $NAME" > /dev/null CHECK=$? if [ $CHECK -eq 0 ]; then echo "Teamspeak server is already running." exit 1 else echo "Starting $DESC: $NAME" cd $DIR && screen -A -d -m -S $NAME ./$DAEMON $PARAMS fi ;; stop) if [[ `screen -ls |grep $NAME` ]] then echo -n "Stopping $DESC: $NAME" kill `ps aux | grep -v grep | grep "SCREEN -A -d -m -S $NAME" | awk '{print $2}'` echo " ... done." else echo "Coulnd't find a running $DESC" fi ;; status) ps aux | grep -v grep | grep "SCREEN -A -d -m -S $NAME" > /dev/null CHECK=$? if [ $CHECK -eq 0 ]; then echo "Teamspeak server running" else echo "Teamspeak server is not running" fi ;; *) echo "Usage: $0 {start|stop|status}" exit 1 ;; esac exit 0Last edited by aeular; 21-12-2009 at 04:53.
-
21-12-2009, 10:33 #3
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 2
you could just use Lingon to add teamspeak as a mac os x launchd service via a nice gui
-
21-12-2009, 16:52 #4
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Dallas, TX, USA
- Posts
- 23
Agreed! Running through launchd is very preferable. I didn't know about Lingon. Thanks for the link. It takes all the fun out of making launchd services.
Last edited by NerfYoda; 21-12-2009 at 20:38.
-
22-12-2009, 02:23 #5
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- London, UK
- Posts
- 10
For some reason if I try and start the ts3server_mac binary from anywhere but inside the directory it lives in, I get the error that it can't load the DB library and bails out.
Do I need to copy the db library files into a location on my system or do I need to specify something on the command line when I launch the server to make it use the correct db library?
-
22-12-2009, 04:17 #6
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Dallas, TX, USA
- Posts
- 23
Try setting LD_LIBRARY_PATH to your server's directory before you start it. If you're using that shell script then you may need to cd to that directory from within your screen session. Encapsulating that in a shell script should do the trick.
-
22-12-2009, 06:17 #7
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- London, UK
- Posts
- 10
Setting that variable definitely helped. Now I'm getting
I imagine that's because I'll need to specify the paths to those sql scripts on the command line. I'll put that stuff in an ini and pass that in...Code:2009-12-22 06:14:55.050314|CRITICAL|DatabaseQuery | | setSQLfromFile( file:sql/create_sqlite/create_tables.sql) failed
Thanks Guys!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
»»» FAQ - TS 2.x Server
By Michael in forum [TeamSpeak 2] Server SupportReplies: 158Last Post: 29-12-2009, 23:20 -
Cannot connect to server by LAN or WAN
By Basti504 in forum [TeamSpeak 2] Server SupportReplies: 5Last Post: 25-11-2007, 22:30 -
Administration page
By bigteam0385 in forum [TeamSpeak 2] Server SupportReplies: 5Last Post: 16-01-2006, 22:00 -
Neuerdings Start Problem
By brendy in forum [TeamSpeak 2] Server SupportReplies: 6Last Post: 02-01-2006, 17:11 -
TS server and wn 98 probs ?
By ghboom in forum [TeamSpeak 2] Server SupportReplies: 0Last Post: 30-05-2003, 06:05


Reply With Quote