Forum

Results 1 to 14 of 14
  1. #1
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956

    Exclamation [Request] Provide the linux startscript.sh with a setting to run as a different user.

    Inside this file it even explains it isn't a good idea to run as root. Yet there is no provision to run the ts3 service as anything but root. There should be some kind of thing that can be uncommented and a name typed in so that when you are typing service ts3server start that it would actually start as that defined user instead of root. Right now running as root is only fine if you are not running anything else on the server and is no good if you already have a server you are using for other things and want to add teamspeak server to it.

    Considering it would only be needing a tweak to the script some how, this should be pretty easy to implement for the developers, just something simple so it can be started under a user defined username rather than root.

  2. #2
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Oh please don't!

    What's wrong with "su <other_user> -c './ts3_startscript.sh'''?
    If there would be such option, what's supposed to happen if you execute "su my_preferred_user -c './ts3_startscript.sh'" (that's what you usually do)? If something goes wrong, it's harder to debug.

    (Cross-Reference to linux server support)

  3. #3
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956
    Because that is if you are manually running the script or having it run through some "Run this every time the system boots". That start script is for it to be run as a system service. The other script is for one time manual or automated runs. The startscript needs a modification so that you can set a username in there and it will then run as the username when the system goes starting all the system services. Very different than what you are talking about.

  4. #4
    Join Date
    September 2005
    Location
    Germany / Dortmund
    Posts
    1,376
    Yeah, I know what you are trying to do. But there are better solutions to do that, for example an entry in rc.local.

  5. #5
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956
    That is not better. That script is for running it as a system service and accepts the classic start, stop, status commands via service command. Please stop offering alternatives when I am asking for something specific to enhance the security. Thank you.

  6. #6
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,528
    Quote Originally Posted by Morthawt View Post
    That is not better. That script is for running it as a system service and accepts the classic start, stop, status commands via service command. Please stop offering alternatives when I am asking for something specific to enhance the security. Thank you.
    Sorry mate... but this is nonsense.

  7. #7
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956
    This isn't nonsense. If you watch the video I made you will see me linking it up as a system service correctly. Oh and thanks for the nonsense negative rep just because you see no benefit. There are 2 scripts, one is a system service and one is a run it when ever. Sure you can run the one that is designed to be a service without having it be a service, but it is the point of how it is designed. It is an init.d script. Period. As I have said elsewhere on here, many other daemons have settings to set the username it runs as. It isn't hard to understand...

  8. #8
    Join Date
    October 2003
    Location
    Germany
    Posts
    2,528
    Well... if you really think you need to do some fancy startscript hacking (just because the TS3 server comes with a crappy old-fashioned startscript that looks like an init.d script to you), then modify it the way you think it should be and upload it to the addons page.

    I just think there are other, more elegant ways to do this that are optimized for your distribution. For example, here's the startscript from the Gentoo ebuild (a bit dirty too, but still better than the servers startscript):

    http://data.gpo.zugaina.org/gentoo/m...eak3-server.rc

  9. #9
    Join Date
    October 2010
    Location
    Warsaw / Poland
    Posts
    296
    Also T-Down from me. Not needed, there are much important things to be done, f.e. IPv6 support.

  10. #10
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956
    This would take them 2 minutes to just modify the script. That is all that is needed, it isn't a big job. They know enough to set a script up so they just need to take the 3 minutes needed to make it secure and easy for people to run it as something other than root when it is installed as a service correctly. This won't take any time away from other things.

  11. #11
    Join Date
    February 2012
    Location
    Nuremberg, Bavaria
    Posts
    258
    Hello,
    Quote Originally Posted by Morthawt View Post
    Because that is if you are manually running the script or having it run through some "Run this every time the system boots". That start script is for it to be run as a system service.
    yes, of course... I've created my own script for system startups:

    Quote Originally Posted by linux shell
    $ cat /etc/init.d/ts3server
    Code:
    #!/bin/bash
    echo "The TeamSpeak server will be started..."
    
    # User, which is starting the server
    USER=teamspeak
    
    # Installation path of server
    DIR=/home/teamspeak
    
    # Make sure, that the PID of the last startup is deleted
    # If it still exists, the server will return an error message and does not startup
    rm -rf $DIR/ts3server.pid
    
    # If you want to delete the old logs ofter each system startup, you have to uncomment the following line
    #rm -rf $DIR/logs/*
    
    # Start server
    su -c "$DIR/ts3server_startscript.sh $1" - $USER
    And: A variable in the script is not good, because not everyone can script and does know, what a variable is... The most users would not know, how they have to fill it out...

  12. #12
    Join Date
    October 2010
    Location
    Warsaw / Poland
    Posts
    296
    @Sebi94
    Change USER=teamspeak to USER=$1
    And DIR=/home/teamspeak to DIR="/home/$USER"
    And lastly su -c "$DIR/ts3server_startscript.sh $1" - $USER to su $USER -c "$DIR/ts3server_startscript.sh $2"

    This way you can execute your script as bash script.sh teamspeak start, or bash script.sh myuser start.
    Cheers.

  13. #13
    Join Date
    December 2009
    Location
    Germany
    Posts
    2,356
    Quote Originally Posted by Sebi94 View Post
    And: A variable in the script is not good, because not everyone can script and does know, what a variable is... The most users would not know, how they have to fill it out...
    A variable is great. Even if a user don't have any experience in shell scripts, I'm sure he can read comments. :-)
    Just add something like: Don't edit anything below this line!

  14. #14
    Join Date
    May 2012
    Location
    The 3rd dimension
    Posts
    956
    Quote Originally Posted by Stefan1200 View Post
    A variable is great. Even if a user don't have any experience in shell scripts, I'm sure he can read comments. :-)
    Just add something like: Don't edit anything below this line!
    Exactly my point. It is the easiest way of making this happen. To the guy who says a variable in a script isn't good, you would rather expect them to memorize su commands and go through the system to add script to an auto-run file rather than edit a variable in a script? Please... This clearly is the easiest option for the user.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 100
    Last Post: August 17th, 2012, 08:38 PM
  2. Replies: 4
    Last Post: May 24th, 2011, 11:55 PM
  3. Linux-Startscript for Teamspeak3 (without screen)
    By zeitsofa in forum Tools / Web Based
    Replies: 8
    Last Post: February 2nd, 2010, 05:47 PM

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
  •