English   German
  #1  
Old 27-08-2002, 15:04
Jovi Jovi is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Fin
Posts: 8
Jovi is on a distinguished road
Send a message via ICQ to Jovi
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.
Reply With Quote
  #2  
Old 27-08-2002, 15:19
R. Ludwig R. Ludwig is offline
-= TeamSpeak Team =-
 
Join Date: Jun 2002
Location: Germany
Posts: 1,089
R. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant future
# kill -TERM `cat /home/tss/tss2.pid`
killall -9 server_linux

if u do that, channel settings are not stored.
Reply With Quote
  #3  
Old 27-08-2002, 16:13
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
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
Reply With Quote
  #4  
Old 27-08-2002, 16:18
R. Ludwig R. Ludwig is offline
-= TeamSpeak Team =-
 
Join Date: Jun 2002
Location: Germany
Posts: 1,089
R. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant future
thats fine :P
Reply With Quote
  #5  
Old 27-08-2002, 16:20
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
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

?!
Reply With Quote
  #6  
Old 27-08-2002, 16:29
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
Following FHS and LSB guidelines, the INI file should probably be in /etc, DB in /var/lib/misc, and log in /var/log.
Reply With Quote
  #7  
Old 27-08-2002, 16:35
Rrroot Rrroot is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: NL
Posts: 28
Rrroot is on a distinguished road
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..
Reply With Quote
  #8  
Old 27-08-2002, 16:45
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
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!
Reply With Quote
  #9  
Old 27-08-2002, 16:48
Jovi Jovi is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Fin
Posts: 8
Jovi is on a distinguished road
Send a message via ICQ to Jovi
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.
Reply With Quote
  #10  
Old 27-08-2002, 16:59
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
"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.)
Reply With Quote
  #11  
Old 27-08-2002, 18:09
R. Ludwig R. Ludwig is offline
-= TeamSpeak Team =-
 
Join Date: Jun 2002
Location: Germany
Posts: 1,089
R. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant futureR. Ludwig has a brilliant future
-db=
-pid=
-ini=
-log=

that are all valid
Reply With Quote
  #12  
Old 27-08-2002, 18:47
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
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.)
Reply With Quote
  #13  
Old 27-08-2002, 19:16
tupsi tupsi is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: germany
Posts: 18
tupsi is on a distinguished road
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
Reply With Quote
  #14  
Old 29-08-2002, 02:29
PanterA PanterA is offline
-= TeamSpeak User =-
 
Join Date: Aug 2002
Location: Denver CO
Posts: 6
PanterA is on a distinguished road
-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
Reply With Quote
  #15  
Old 29-08-2002, 03:25
ScratchMonkey ScratchMonkey is offline
-= TeamSpeak Addict =-
 
Join Date: Jun 2002
Location: Northern California
Posts: 350
ScratchMonkey is on a distinguished road
You're keeping the DB file in the root directory? Why?

I'm keeping mine in /etc/tss2/server.db.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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