|
|
|

27-08-2002, 15:04
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: Fin
Posts: 8
|
|
|
My modified Start-up script
It is not very good idea to run TS server with root priviledges cos of security holes this nice software might have.
I modified server start-up script to run server with user account made only for this use.
1. adduser tss
--> creates new user named tss
2. unpack & move server files to /home/tss directory
3. copy paste lines below in file and name it "tss.sh"
4. make tss.sh script executable -> chmod 755 tss.sh
#! /bin/bash
# Copyright (c) 2001 TeamSpeak team All rights reserved.
#
# Author: Niels Werensteijn 2001
#
# /etc/init.d/tss.sh
#
### BEGIN INIT INFO
# Provides: tss
# Required-Start: $network
# Required-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description: TeamSpeakServer
### END INIT INFO
cd /home/tss
if [ "$UID" = "0" ]; then
exec "su" - tss -c "/home/tss/tss.sh $1"
fi
case "$1" in
start)
echo Starting TeamSpeak 2 Server Daemon
/home/tss/server_linux -PID=/home/tss/tss2.pid > /dev/null
;;
stop)
echo Stopping TeamSpeak Sercer Daemon
# kill -TERM `cat /home/tss/tss2.pid`
killall -9 server_linux
;;
restart)
$0 stop && $0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Last edited by Jovi; 27-08-2002 at 15:11.
|

27-08-2002, 15:19
|
|
-= TeamSpeak Team =-
|
|
Join Date: Jun 2002
Location: Germany
Posts: 1,089
|
|
|
# kill -TERM `cat /home/tss/tss2.pid`
killall -9 server_linux
if u do that, channel settings are not stored.
|

27-08-2002, 16:13
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: NL
Posts: 28
|
|
Easy fix to that Ludwig:
echo Stopping TeamSpeak Sercer Daemon
kill -TERM `cat /home/tss/tss2.pid`
sleep 3
killall -9 server_linux
If you do it like above, you'll properly kill the teamspeak2 engine and safe the settings you want saving. After that leave 3 secs for the server to go down and then brutaly slap the rest of the webengine down
|

27-08-2002, 16:18
|
|
-= TeamSpeak Team =-
|
|
Join Date: Jun 2002
Location: Germany
Posts: 1,089
|
|
|
thats fine :P
|

27-08-2002, 16:20
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: NL
Posts: 28
|
|
|
Now that I've got you attention anyways...
'--DB=' is a valid flag to pass on server_linux to redirect it to a server.db located in a different place then the tss2 directory?
I have my programs in /usr/local/tss2
and I want my ini/db/log in /var/log/tss2
?!
|

27-08-2002, 16:29
|
|
-= TeamSpeak Addict =-
|
|
Join Date: Jun 2002
Location: Northern California
Posts: 350
|
|
|
Following FHS and LSB guidelines, the INI file should probably be in /etc, DB in /var/lib/misc, and log in /var/log.
|

27-08-2002, 16:35
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: NL
Posts: 28
|
|
|
Sorry to say, but that wasn't my question... is '-DB' the correct switch to use for placing the server.db in another location?
Cause when I do so it tries to use the server.db from another location, where I put it, but it leaves me with a useless server cause it will not authenticate me.
First I need to check that and then I can place it in any directory structure I like.. most of my databases are under /var/lib btw.. just like mysql, dhcpd etc..
|

27-08-2002, 16:45
|
|
-= TeamSpeak Addict =-
|
|
Join Date: Jun 2002
Location: Northern California
Posts: 350
|
|
|
Sorry, I was just addressing the part I know about. I'm not one of the coders, so I don't actually know anything about the DB option. I'm in the process of creating an RPM, so I'm watching this thread with interest!
|

27-08-2002, 16:48
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: Fin
Posts: 8
|
|
Quote:
Originally posted by R. Ludwig
# kill -TERM `cat /home/tss/tss2.pid`
killall -9 server_linux
if u do that, channel settings are not stored.
|
oh, this explains aswell why those settings do not stay in reboot either...thx for info
Last edited by Jovi; 27-08-2002 at 16:51.
|

27-08-2002, 16:59
|
|
-= TeamSpeak Addict =-
|
|
Join Date: Jun 2002
Location: Northern California
Posts: 350
|
|
|
"kill -9" should always be used as a last resort.
BTW, anyone plan to run on Solaris? If so, don't use killall. It has a totally different function on Solaris that's more dangerous. (I haven't encountered this personally, but I've read posts on newsgroups and mailing lists from plenty of people who have.)
When invoking an external binary from a script, always use the full path. Or explicitly set your path at the top of the script. Too many admins get trojaned by some user leaving a malicious program in his home directory named "ls" or other common utility. (That's why you shouldn't have "." in your path.)
|

27-08-2002, 18:09
|
|
-= TeamSpeak Team =-
|
|
Join Date: Jun 2002
Location: Germany
Posts: 1,089
|
|
|
-db=
-pid=
-ini=
-log=
that are all valid
|

27-08-2002, 18:47
|
|
-= TeamSpeak Addict =-
|
|
Join Date: Jun 2002
Location: Northern California
Posts: 350
|
|
|
Feature request: -HTML=, to find the httpdocs directory. I want to put that in /usr/share/tss2/httpdocs, and have the program find it using the command line option. (Most Linux programs with "skinnable" GUI's keep that kind of thing in /usr/share.)
|

27-08-2002, 19:16
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: germany
Posts: 18
|
|
Quote:
Originally posted by R. Ludwig
-db=
-pid=
-ini=
-log=
that are all valid
|
Hello
i tried a bit with all the parameters and sorry to say, but -DB is def. not working. My server will only recognises the server.db file.
the others work just fine.
Tupsi
|

29-08-2002, 02:29
|
|
-= TeamSpeak User =-
|
|
Join Date: Aug 2002
Location: Denver CO
Posts: 6
|
|
|
-DB=
I used -DB= in my start scripts and it works kinda. If I am to reboot the box -DB=/path/to /my/db works and it recognizes and uses the correct db. If I restart the process via the script it will not use the correct db unless I use this (exactly as typed)
-DB=/tsserver.db and it does find -DB=/path/to /my/db. If I reboot with -DB=/tsserver.db it of course looks for the .db on /
Go figure...
So what I've done is made a boot time script and a restart script and it seems to be fine. This is on RH 6.2 on an old router/NAT box. I'm not sure if the old ver of RH is causing this or not but this is what I have to do
|

29-08-2002, 03:25
|
|
-= TeamSpeak Addict =-
|
|
Join Date: Jun 2002
Location: Northern California
Posts: 350
|
|
|
You're keeping the DB file in the root directory? Why?
I'm keeping mine in /etc/tss2/server.db.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 00:00.
Powered by vBulletin® Version 3.7.3 Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
|
|
|
|
Add to Bookmarks
|
Printview
|
Contact Us
|
Legal Notices
|