Community Forums Today's Posts     Member List     Archive    
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    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 14:11.

  2. #2
    Join Date
    Jun 2002
    Location
    Krün / Germany
    Posts
    1,965
    # kill -TERM `cat /home/tss/tss2.pid`
    killall -9 server_linux

    if u do that, channel settings are not stored.

  3. #3
    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

  4. #4
    Join Date
    Jun 2002
    Location
    Krün / Germany
    Posts
    1,965
    thats fine :P

  5. #5
    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

    ?!

  6. #6
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    Following FHS and LSB guidelines, the INI file should probably be in /etc, DB in /var/lib/misc, and log in /var/log.

  7. #7
    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..

  8. #8
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    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!

  9. #9
    Join Date
    Aug 2002
    Location
    Fin
    Posts
    8
    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 15:51.

  10. #10
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    "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.)

  11. #11
    Join Date
    Jun 2002
    Location
    Krün / Germany
    Posts
    1,965
    -db=
    -pid=
    -ini=
    -log=

    that are all valid

  12. #12
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    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.)

  13. #13
    Join Date
    Aug 2002
    Location
    germany
    Posts
    18
    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

  14. #14
    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

  15. #15
    Join Date
    Jun 2002
    Location
    Northern California
    Posts
    351
    You're keeping the DB file in the root directory? Why?

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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. please help someone
    By theundead67 in forum [TeamSpeak 2] Server Support
    Replies: 59
    Last Post: 31-03-2007, 04:53
  2. Server Start Script issues
    By spencerjw in forum [TeamSpeak 2] Server Support
    Replies: 7
    Last Post: 23-02-2006, 19:06
  3. Where Can i find ts server START SCRIPT
    By mooreh in forum [TeamSpeak 2] Server Support
    Replies: 3
    Last Post: 01-03-2005, 22:14
  4. Start stop script for TeamSpeak daemon (init)
    By Cybernaut in forum [TeamSpeak 2] Server Support
    Replies: 2
    Last Post: 11-11-2004, 17:07
  5. Start script..
    By NitroSniper in forum [TeamSpeak 2] Addons & Scripts
    Replies: 3
    Last Post: 27-08-2002, 07:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •