Results 1 to 12 of 12
Thread: Nice And Easy Linux Start Script
-
23-12-2009, 07:15 #1
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
Nice And Easy Linux Start Script
Edit by mod
Please don't use this outdated script anymore! The script got an overhaul long time ago.
Please use the minimal or startscript instead
Hello All,
If you are like me and like to have a simple script with lots of options you will like this.
To get the script:
Now you will need to edit the 4th line down in that file with your favorite editorCode:wget http://scripts.the009.net/shell/ts3/startscript
change the line to match your information:
Now once you have that done, you will need to CHMOD that file to be able to run.cd /teamspeak/teamspeak3-server_linux-x86
Now that is done you will need the config file for the startscript.Code:chmod +x startscript
You will need to edit the config file to match your stuff.Code:wget http://scripts.the009.net/shell/ts3/startscript.conf
Once you have all that done its very simple to start or watch what is happening to your server or even stop or restart it.
To start the server use:
To Stop your server use:Code:./startscript start
To Restart your server use:Code:./startscript stop
To watch what your server is doing use:Code:./startscript restart
IMPORTANT INFORMATION:Code:./startscript watch
If you are watching your server with ./startscript watch you must close the screen before exiting your shell.
Use:
Hope that helps all of you out.Code:CTRL + A + D
Regards,
The009
PS: If this could be stickied for quick find for help that would be awesome.Last edited by dante696; 21-02-2011 at 12:24. Reason: Asking For Sticky
-
23-12-2009, 11:14 #2
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 27
In this script the startparms in this startscript (http://forum.teamspeak.com/showthread.php?t=47075) . The idea, use the config is very usefull after first start. Thanks for inspiration
-
23-12-2009, 16:24 #3
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
I like using config file because it keeps the clutter and everything down.
There is no need to have to look though a ton of coding or other things with a config file and then an actual start script.
-
24-12-2009, 08:54 #4
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- az usa
- Posts
- 4
does this script keep the server running 24/7??
-
24-12-2009, 10:30 #5
-= TeamSpeak User =-
- Join Date
- May 2007
- Location
- Germany
- Posts
- 9
This is what you have to type if you want to start the server 24/7:
To Detach the screen press CTRL + A simutaniously and then hit you d key.Code:screen -A -m -d -S ts3 ./ts3server_linux_x86
To Reattach type
hint: you must have installed screen (apt-get install screen)Code:screen -r ts3
-
25-12-2009, 02:21 #6
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
-
25-12-2009, 02:28 #7
-= TeamSpeak Lover =-
- Join Date
- Mar 2005
- Location
- Germany
- Posts
- 51
why not just start the server with:
Code:./ts3server_linux_x86 &
-
25-12-2009, 02:31 #8
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
-
25-12-2009, 02:53 #9
why is everyone using screen ???
my TS3 on my nix box is running without screen... and no active SSH for it..
i dont get it...
-
25-12-2009, 12:45 #10
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- Germany
- Posts
- 4
Here is a script without screen, uses debian start-stop-daemon. Sould be running on debianbased distributions.
Just pass user, group, directory and your options
Start teamspeak after reboot, copy script to /etc/init.d/tss3Code:#!/bin/bash #Teamspeak 3 startup script PATH=/sbin:/bin:/usr/sbin:/usr/bin:$DIR #Server options NAME="TeamSpeak 3 Server" DESC="tss3" DIR="/home/tss3" BIN="ts3server_linux_x86" PIDFILE="/home/tss3/tss3.pid" PARAMS="inifile=ts3server.ini" USER="tss3" # DO NOT USE root GROUP="tss3" # DO NOT USE root ### Do not edit anything below this line ### set -e export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:." . /lib/lsb/init-functions if [ ! -d "$DIR" ]; then log_failure_msg "Directory does not exist!" exit 0 fi if [ ! -e "$DIR/$BIN" ]; then log_failure_msg "$BIN does not exist!" exit 0 fi if [ ! -x "$DIR/$BIN" ]; then log_failure_msg "$BIN not executable!" exit 0 fi if [ -z "$USER" ]; then log_failure_msg "Username is not set!" exit 0 fi if [ -z "$GROUP" ]; then log_failure_msg "GROUP is not set!" exit 0 fi TEST=`ps ax | grep $BIN | grep -v grep | wc -l` start() { if [ $TEST = 1 ]; then log_begin_msg "$NAME already running with Pid: `tail $PIDFILE`" else log_progress_msg "Starting $NAME" start-stop-daemon --start --chdir $DIR --exec $DIR/$BIN --startas $BIN --make-pidfile --pidfile $PIDFILE --user $USER --group $GROUP --chuid $USER:$GROUP --background -- $PARAMS chown $USER:$GROUP $PIDFILE log_end_msg 0 fi } stop() { if [ ! $TEST = 1 ]; then log_begin_msg "$NAME not running!" else log_progress_msg "Stopping $NAME" start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --user $USER --exec $DIR/$BIN rm -rf $PIDFILE log_end_msg 0 fi } restart() { echo "Stopping $NAME" start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE --user $USER --exec $DIR/$BIN rm -rf $PIDFILE sleep 1 echo ... echo "Starting $NAME" start-stop-daemon --start --chdir $DIR --exec $DIR/$BIN --startas $BIN --make-pidfile --pidfile $PIDFILE --user $USER --group $GROUP --chuid $USER:$GROUP --background -- $PARAMS chown $USER:$GROUP $PIDFILE } status() { if [ $TEST = 1 ]; then echo "$NAME running with Pid: `tail $PIDFILE`" else echo "$NAME not running" fi } case "$1" in start) start ;; stop) stop ;; restart|force-reload) restart ;; status) status ;; *) log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0
Code:update-rc.d tss3 defaults
When you running monit for monitoring you can add:
Code:check process ts3server_linux_x86 with pidfile /home/tss3/tss3.pid start program = "/etc/init.d/tss3 start" stop program = "/etc/init.d/tss3 stop" if failed host YOURIP port YOURPORT type udp then restart
Last edited by get.the.MaX; 25-12-2009 at 22:45.
-
07-01-2010, 18:07 #11
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
I run CentOS so things are a bit different then debian.
But the script should work on all of the Distros.
Hopefully people have found it helpful.
-
04-02-2010, 17:22 #12
-= TeamSpeak User =-
- Join Date
- Dec 2009
- Location
- USA
- Posts
- 8
Hello,
If you got this script Before Beta 17 Please Change Your startscript.conf
DSNAME='ts3server_minimal_runscript.sh';
To Match That As Above, IF you are just getting this script. It will work fine for you.
Regards,
The009
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)


Reply With Quote




