SRCDS Steam group


Need Help for Linux srcds start script
#1
hello i try to start linux server with certain user like that :

#!/bin/sh
st_user="MY USER"
chown $st_user -R /home/MY USER/srcds/cstrike/addons/sourcemod/logs/
cd /home/MY USER/srcds/
su - $st_user screen -A -m -d -S test ./srcds_run -game cstrike -console +maxplayers 32 +port 27023 +ip 1.2.3.4 -tickrate 66 +map de_dust2

but the server starts with root ... can someone help me to fix it
Reply
#2
try
sudo -u $st_user screen ...
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#3
I guess it should be:
su $st_user -c screen bla bla bla

Anyway why run as root/su and switch back to a different User? Are you planning to implement it in the init.d? If not remove the su and st_user part, login with the desired user and execute your startscript with the desired user.
Reply
#4
i tried what you said and it did not work ... server starts with root all the time

last i tried with :

#!/bin/sh
chown -R user:user /home/user/copysrcds/cstrike/addons/sourcemod/logs/
su user
cd /home/user/backup/copysrcds/
screen -A -m -d -S test ./srcds_run -game cstrike -console +maxplayers 32 +port 27023 +ip 1.2.3.4 -tickrate 66 +map de_dust2

and still starts with root Sad

what is wrong
Reply
#5
for mine I have

Code:
#!/bin/sh
su -c "/startscripts/username.sh" - username
su -c "/startscripts/username2.sh" - username2

in my init.d folder to call scripts that have something along the lines of below:

Code:
#!/bin/sh

screen -AmdS 1-username ./srcds_run -game cstrike -ip 111.111.111.111 -port 27015 -maxplayers 11 -tickrate 100 +fps_max 0 +map de_dust2 +servercfgfile server.cfg +tv_enable 1 +tv_maxclients 5 +tv_port 27020 -autoupdate

It seems to work fine for me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)