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:
I'm not yet super well versed in linux permissions systems, but here's the output of my ls -al on the folder:
Anyone have any suggestions?
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?
Share this post:
Responses (5)
-
Accepted Answer
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://sfj48-fkj200.heiksthsd.cf/resources/documentation/clearos/content:en_us:kb_howtos_teamspeak_2_and_teamspeak_3_to_clearos
hope this will help you a bit. -
Accepted Answer
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. -
Accepted Answer
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? -
Accepted Answer
-
Accepted Answer
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
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »