Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 3 of 3
  1. #1
    Join Date
    May 2013
    Posts
    8

    Server service not working after update

    Hi,

    Today I updated my Linux TS3 server from version 3.0.11.x to 3.0.13.6 but it now fails to start up as a service.

    The way my server is set up:

    The server is stored in /opt/teamspeak3-server/
    The files are all owned by a user called teamspeak3-user (chown -R teamspeak3-user:teamspeak3-user *)
    The file /etc/init.d/ts3 contains the following:
    Code:
    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides:          ts3
    # Required-Start:    $network mysql
    # Required-Stop:     $network
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: TeamSpeak3 Server Daemon
    # Description:       Starts/Stops/Restarts the TeamSpeak3 Server Daemon
    ### END INIT INFO
    
    set -e
    
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    DESC="TeamSpeak3 Server"
    NAME=teamspeak3-server
    USER=teamspeak3-user
    DIR=/opt/teamspeak3-server
    OPTIONS=inifile=ts3server.ini
    DAEMON=$DIR/ts3server_startscript.sh
    #PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    
    # Gracefully exit if the package has been removed.
    test -x $DAEMON || exit 0
    
    sleep 2
    sudo -u $USER $DAEMON $1 $OPTIONS
    There were no problems with the service running before I did the update.
    The steps I took to update were:
    Stop the service.
    Backup the /opt/teamspeak3-server/ directory.
    Extract the new version in to the /opt/teamspeak3-server/ directory.
    Ran chown to change ownership of overwritten files to teamspeak3-user.
    Rebooted the system.

    No TeamSpeak3 server to connect to!

    So I checked the status of the service with "service ts3 status" and got the following:

    Code:
    ● ts3.service - LSB: TeamSpeak3 Server Daemon
       Loaded: loaded (/etc/init.d/ts3; bad; vendor preset: enabled)
       Active: active (exited) since Fri 2017-02-03 14:27:01 GMT; 13s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 2807 ExecStop=/etc/init.d/ts3 stop (code=exited, status=0/SUCCESS)
      Process: 3279 ExecStart=/etc/init.d/ts3 start (code=exited, status=0/SUCCESS)
    
    Feb 03 14:26:59 galbi3000-linux systemd[1]: Starting LSB: TeamSpeak3 Server Daemon...
    Feb 03 14:27:01 galbi3000-linux sudo[3283]:     root : TTY=unknown ; PWD=/ ; USER=teamspeak3-user ; COMMAND=/opt/teamspeak3-server/ts3server_startscript.sh start inifile=ts3server.ini
    Feb 03 14:27:01 galbi3000-linux sudo[3283]: pam_unix(sudo:session): session opened for user teamspeak3-user by (uid=0)
    Feb 03 14:27:01 galbi3000-linux ts3[3279]: sudo: unable to execute /opt/teamspeak3-server/ts3server_startscript.sh: Permission denied
    Feb 03 14:27:01 galbi3000-linux sudo[3283]: pam_unix(sudo:session): session closed for user teamspeak3-user
    Feb 03 14:27:01 galbi3000-linux systemd[1]: Started LSB: TeamSpeak3 Server Daemon.
    So I tried running the server directly using ts3server_minimal_runscript.sh and it reported the database was in use and kept timing out waiting for it to free up so I stopped that and then stopped the ts3 service and tried running the server again with ts3server_minimal_runscript.sh. The server ran fine using the script!

    So, why is it not working as a service any more? How can I fix it?

  2. #2
    Join Date
    May 2013
    Posts
    8
    Ok, after some experimentation I have fixed the problem (I am fairly new to advanced Linus stuff)!

    Here is how I fixed it:

    I surmised that the services default to running as root user and could see that the ts3 server was being run as user teamspeak3-user (I followed a YouTube video on how to set up the server and that's how they set it up, so don't blame me :P ) and as I was successfully starting it manually as root user all I had to so was run the service as root!

    So I changed the ownership of all the files/directories in the /opt/teamspeak3-server/ directory with chown to root:root.
    I edited the ts3 service script file so that the last line reads "$USER $DAEMON $1 $OPTIONS" instead of "sudo -u $USER $DAEMON $1 $OPTIONS".

    After those 2 changes the TS3 server runs as a service again

  3. #3
    Join Date
    December 2016
    Location
    Germany
    Posts
    32
    Running the server as root is NOT the way you should have done this......
    Running it as a normal user would be far better in terms of security.
    I have a script that works without root-permissio, if you want it i can send it to you.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Teamspeak "Service" Not working Due to Errors
    By jackd019 in forum Linux / FreeBSD
    Replies: 0
    Last Post: November 23rd, 2013, 09:13 AM
  2. Replies: 3
    Last Post: July 9th, 2013, 09:34 PM
  3. Replies: 3
    Last Post: November 8th, 2012, 01:22 PM
  4. [No Bug] Invite only Server stopped working since last update (3.0.3)
    By urbo83 in forum Bug Reports [EN/DE]
    Replies: 4
    Last Post: May 2nd, 2012, 09:08 AM
  5. [BUG] Accounting - failed to update accounting service
    By rolfie in forum Server Support
    Replies: 23
    Last Post: February 12th, 2010, 06:29 PM

Posting Permissions

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