Forum

Results 1 to 2 of 2
  1. #1
    Join Date
    December 2009
    Location
    Germany
    Posts
    14

    Post HOWTO: modified start script for auto starting on server boot (ts3 as non-root user)

    hey guys,

    i just modified the original starting script because it doesn't change users - and no one want to run ts3 as root!

    without changing users, the script isn't runnable as auto start on server boot.

    i'm sure my solution isn't the best - but my bash scripting knowledge is to bad for some better results. it works anyway and is secure.

    the hole thing was tested under ubuntu 9.10 karmic.

    ####################################
    Link broken

    - move the startscript.sh into your TS3 binaries folder (/home/teamspeak3/ts3 was my example)
    - move the teamspeak3 into /etc/init.d
    - both files mist have permission to be executable (chmod +x)

    - now edit both files for your server settings

    startscript.sh
    COMMANDLINE_PARAMETERS="" #add any command line parameters you want to pass here
    BINARYPATH="" # your path to your ts3 binaries


    and

    /etc/init.d/teamspeak3
    BINARYPATH="" # your path to your ts3 binaries
    SYS_USER="" # your user to run ts3 as (never use root!)


    - check the correct file-rights of your files!
    /etc/init.d/teamspeak3 should look like this: -rwxr-xr-x 1 root root

    your startscript.sh should have the same user rights as your teamspeak3 user.

    now we create the automatic start script (should work under debian with the same command too? not sure!)

    Creating Start Script with priority of 99:
    Code:
    update-rc.d teamspeak3 defaults 99
    you getting this:
    Adding system startup for /etc/init.d/teamspeak3 ...
    /etc/rc0.d/K99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc1.d/K99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc6.d/K99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc2.d/S99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc3.d/S99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc4.d/S99teamspeak3 -> ../init.d/teamspeak3
    /etc/rc5.d/S99teamspeak3 -> ../init.d/teamspeak3
    starting/stopping manually works like this:
    /etc/init.d/teamspeak3 start

    this works as your teamspeak3 user AND root (which automatically changes into your TS3 user for secure reasons).

    hf.

    ####
    i upped the files as backup, if my webspace goes down. just rename teamspeak3.sh into teamspeak
    Last edited by florian_fr40; November 21st, 2011 at 09:01 AM.

  2. #2
    Join Date
    December 2009
    Location
    Germany
    Posts
    14

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: March 9th, 2015, 09:58 PM
  2. [Resolved] Can't start server as not-root user
    By HerrAusragend in forum Linux / FreeBSD
    Replies: 2
    Last Post: January 29th, 2015, 05:19 AM
  3. Replies: 0
    Last Post: May 4th, 2011, 01:22 AM
  4. Unable to start server as non-root user on VPS
    By jesepi in forum Linux / FreeBSD
    Replies: 5
    Last Post: December 21st, 2009, 01:44 AM

Tags for this Thread

Posting Permissions

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