I have two (17 player) servers, one hlds, one srcds (cs on both though I doubt this is relevant).
I've followed directions for automatically booting on startup, and after some research found how I SHOULD be able to boot up my servers as a particular user via the rc.local file.
Supposedly the following should work:
Code: Select all
su - [b]username[/b] -c "cd /usr/steam/sourcebase/orangebox && screen -AmdS screenname chrt -r 20 ./srcds_run -game cstrike -ip xxx.xxx.xxx.xxx -maxplayers xx"
This causes nothing to happen (either on boot or when executing rc.local manually). After more digging I found "runuser" (similar command and is based in su) so I tried this
Code: Select all
runuser - [b]username[/b] -c "cd /usr/steam/sourcebase/orangebox && screen -AmdS screenname chrt -r 20 ./srcds_run -game cstrike -ip xxx.xxx.xxx.xxx -maxplayers xx"
Obviously I have two software servers running so that single line could be way longer or I could create a second line with essentially the same code. But ultimately this method does not work at all.
I've been fiddling with this for hours because as we all know; running public services as root is usually a very bad idea. I want to disable root save for specific tasks (like updates, etc.) and I know how to do this; but this is stopping me for now.