On my VDS, when I run "chrt -r 20" with my start command I get the following output:
sched_setscheduler: Operation not permitted
failed to set pid 0's policy
I was told that this sounds as though I may be running the command as a non-root user. This is true and running the command as root does allow the server to boot however, I'd prefer not to run the server as a root user because it presents a potential security issue. Any help on how to to get this to work as a non-root user would be appreciated.
chrt -r 20
-
- New to forums
- Posts: 2
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Mon Jan 04, 2010 8:14 pm
Re: chrt -r 20
One way to approach this would be to simply use chrt to execute sudo -- something like this:
Another would be to set up a cronjob as root that chrt's all processes with a certain name or user to the right value at some regular interval.
Code: Select all
chrt -f 50 sudo -u hlds ./srcds_run -game cstrike
Re: chrt -r 20
Thanks for the suggestions.
1. I'm not too clear on the difference between the fifo and rr schedulers though. Why did you put "chrt -f 50" in your example as opposed to "chrt -r 20" like you have in this post?
2. I usually run my servers using screen like so:
screen -A -m -d -S sessionname ./hlds_run -game cstrike
How would I go about using your first suggestion while also running the server via a screen session?
1. I'm not too clear on the difference between the fifo and rr schedulers though. Why did you put "chrt -f 50" in your example as opposed to "chrt -r 20" like you have in this post?
2. I usually run my servers using screen like so:
screen -A -m -d -S sessionname ./hlds_run -game cstrike
How would I go about using your first suggestion while also running the server via a screen session?
Re: chrt -r 20
You can use either one for your game server -- they have the same performance for this application in my testing (the key is the fact that it puts the server into a realtime class, which changes the way timer slack is handled). If chrt -r has been working well for you, I'd say stick with it.mgl wrote:1. I'm not too clear on the difference between the fifo and rr schedulers though. Why did you put "chrt -f 50" in your example as opposed to "chrt -r 20" like you have in this post?
I'd recommend putting screen on the outside so that part runs as root and doesn't get realtime priority:2. I usually run my servers using screen like so:
screen -A -m -d -S sessionname ./hlds_run -game cstrike
How would I go about using your first suggestion while also running the server via a screen session?
Code: Select all
screen -AmdS sessionname chrt -f 50 sudo -u hlds ./srcds_run -game cstrike