Forums

Resolved
0 votes
Hello!

I recently installed 7.2, and I'm getting it all set back up to my previous setup. I'm currently trying to setup a teamspeak 3 server. Previously I had done this as root, and just had it running as root every time the box would reboot, or go down. Now, in the name of security, I've decided to try and set it up as it's own little daemon user, but I'm running into issues. I started by creating the user "tsdaemon", adding the password, then downloading the server file for linux for the website into the "/home/tsdaemon" directory. Once it was down I attempted to tar xvfj the file (it was a bz2 zip), doing that returned an error that said no permission allowed. So I backed out and added the daemon account to my sudoers file, just to get the setup done. Tried again, and I didn't have bzip installed, so I installed bzip, and got my package unzipped.

Next I went into the freshly unzipped folder and tried to run the start script, again issues with permission denied, so I ran it as sudo, success. So I tried backing out again, and changing the owner of the directory to my tsdaemon user (chown tsdaemon /home/tsdaemon/teamspeak_directory_here). Switched back to my daemon user and attempted the start script again, still no luck. Ultimately I want to get this setup to start on reboot automatically by adding a cronjob, but if it can't start by manually running the start script, I don't have a ton of faith in that cronjob working.

What do I need to do to give my daemon user the proper permissions to successfully run that start script? My cron job is just going to be:

@reboot /home/tsdaemon/teamspeak3-server_linux-amd64/ts3server_startscript.sh start


I'm not yet super well versed in linux permissions systems, but here's the output of my ls -al on the folder:

total 12176
drwxrwxr-x 9 tsdaemon 1000 4096 Aug 15 17:16 .
drwx------ 4 tsdaemon tsdaemon 4096 Aug 15 17:05 ..
-rw-rw-r-- 1 1000 1000 49640 Jul 19 07:07 CHANGELOG
drwxrwxr-x 3 1000 1000 4096 Jul 19 05:35 doc
drwx------ 3 root root 28 Aug 15 17:07 files
-rwxrwxr-x 1 1000 1000 1000856 Jul 19 07:07 libts3db_mariadb.so
-rwxrwxr-x 1 1000 1000 2191496 Jul 19 07:07 libts3db_sqlite3.so
-rw-rw-r-- 1 1000 1000 36710 Jul 19 07:07 LICENSE
drwx------ 2 root root 106 Aug 15 17:07 logs
-rw-r--r-- 1 root root 0 Aug 15 17:07 query_ip_blacklist.txt
-rw-r--r-- 1 root root 14 Aug 15 17:07 query_ip_whitelist.txt
drwxrwxr-x 2 1000 1000 28 Jul 19 07:07 redist
drwxrwxr-x 2 1000 1000 8192 Jul 19 05:35 serverquerydocs
drwxrwxr-x 5 1000 1000 8192 Jul 19 05:35 sql
-rwxrwxr-x 1 1000 1000 8615136 Jul 19 07:07 ts3server
-rwxrwxr-x 1 1000 1000 129 Jul 19 07:07 ts3server_minimal_runscript.sh
-rw-r--r-- 1 root root 1024 Aug 15 17:07 ts3server.sqlitedb
-rw-r--r-- 1 root root 32768 Aug 15 17:07 ts3server.sqlitedb-shm
-rw-r--r-- 1 root root 471632 Aug 15 17:07 ts3server.sqlitedb-wal
-rwxrwxr-x 1 1000 1000 2661 Jul 19 07:07 ts3server_startscript.sh
drwxrwxr-x 2 1000 1000 81 Jul 19 07:07 tsdns


Anyone have any suggestions?
Monday, August 15 2016, 10:31 PM
Share this post:
Responses (5)
  • Accepted Answer

    Thursday, August 25 2016, 08:55 PM - #Permalink
    Resolved
    0 votes
    Hello Tyler,

    I have a TS server running on ClearOS 6.7.

    Did you set premission for your tsdemon user including a user groep to the archief file and to all the directory's and files afther you unzipped the files into the directory.

    something like "chown -R tsdemon:allusers /home/tsdemon/install directory here"

    I used a guide to help me out a bit when i installed mine.

    https://www.clearos.com/resources/documentation/clearos/content:en_us:kb_howtos_teamspeak_2_and_teamspeak_3_to_clearos

    hope this will help you a bit.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, August 16 2016, 04:30 PM - #Permalink
    Resolved
    0 votes
    If you don't use the -r switch you get a UID of 1000 or greater. These normally survive until the next reboot. At a guess your user was created with a UID of 1000, but, as it has now vanished, the files remain owned by user 1000 which it cannot identify. You'll probably find he as disappeared from /etc/passwd.

    Can I suggest you try re-creating the user with the -r switch then changing all files owned by 1000 to being owned by tsdaemon. You may also want to check in the /home folder for his home folder. Normally a system user would not get one and you should be able to delete it.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, August 16 2016, 02:50 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    So who is user 1000? Are you using "useradd" to add your tsdaemon user? If so you must use the -r switch to create it as a system user. If you don't, it will end up in the space controlled by LDAP and get wiped on every reboot.


    That's a good question, and one I had too, I'm not sure who user 1000 is, it's definitely not one I had created, I assumed it was some sort of system account. That's a bit concerning.

    When I created the account I did not use the -r switch. I did get this issue working last night though by using the -R switch on my chown command. Using that I was able to go in and start the server with that script, and pull tsdaemon out of the sudoers file. However, and this may play into what you're saying with the system user, I attempted to reboot the server this morning, and when it came back up it doesn't look like the cron job worked. I was still able to use su tsdaemon, and get to my home directory to manually launch the script/server again, but the cron job didn't pick it up. Would that be caused by not having used that -r switch?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, August 16 2016, 07:12 AM - #Permalink
    Resolved
    0 votes
    So who is user 1000? Are you using "useradd" to add your tsdaemon user? If so you must use the -r switch to create it as a system user. If you don't, it will end up in the space controlled by LDAP and get wiped on every reboot.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, August 15 2016, 11:22 PM - #Permalink
    Resolved
    0 votes
    Ah, not sure how I forgot this part, I suppose the most important part, here's the error I get when attempting to run the start script:

    [tsdaemon@hoa teamspeak3-server_linux_amd64]$ ./ts3server_startscript.sh start
    Starting the TeamSpeak 3 server
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    2016-08-15 23:22:06.615411|CRITICAL|ServerLibPriv | |Server() DatabaseError unable to open database file
    ERROR: openFile( file:logs/ts3server_2016-08-15__23_22_06.609993_0.log) failed
    TeamSpeak 3 server could not start
    The reply is currently minimized Show
Your Reply