Raised This Month: $ Target: $400
 0% 

[CSGO] Linux RENICE server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krelle1911
Member
Join Date: Mar 2013
Location: Randers
Old 01-28-2016 , 17:46   [CSGO] Linux RENICE server
Reply With Quote #1

Hi

I'm looking for somone to write a simple updated tutorial on THIS.

I want my servers to be reniced automatically at startup so I dont have to go to htop and do it manually.

I've followed the tutorial on the link but it doesnt seem to work.

Here is my crontab:
Quote:
*/5 * * * * renice -20 `cat /home/steam/csgo27010/srcds.pid` >/dev/null 2>&1
And here is my startline:
Quote:
./srcds_run -console -game "csgo" -pidfile "srcds.pid" -maxplayers_override 12 +mapgroup "mg_bomb" +map "de_dust2" -exec "server.cfg" -ip xxx.xxx.xxx.xxx -port 27010 +exec gamemode_competitive.cfg -usercon +game_type 0 +game_mode 1 -secure -tickrate 128 -pidfile srcds.pid
I am running Ubuntu 14.04 LTS
__________________
Krelle1911 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-29-2016 , 10:11   Re: [CSGO] Linux RENICE server
Reply With Quote #2

You could just use nice to launch srcds_run in the first place.

Having said that, only the root user can set nice to a negative value.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 01-29-2016 at 10:12.
Powerlord is offline
Krelle1911
Member
Join Date: Mar 2013
Location: Randers
Old 01-29-2016 , 13:44   Re: [CSGO] Linux RENICE server
Reply With Quote #3

Quote:
Originally Posted by Powerlord View Post
You could just use nice to launch srcds_run in the first place.

Having said that, only the root user can set nice to a negative value.
Can it be run though sudo? And is -20 higher priority than +20?
__________________
Krelle1911 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-29-2016 , 13:45   Re: [CSGO] Linux RENICE server
Reply With Quote #4

Yes and yes.
psychonic is offline
Krelle1911
Member
Join Date: Mar 2013
Location: Randers
Old 01-30-2016 , 13:18   Re: [CSGO] Linux RENICE server
Reply With Quote #5

Quote:
Originally Posted by psychonic View Post
Yes and yes.
Can you possibly help my found out how to create the startscript with nice? I'm only a basic linux user.

I can't seem to make sense of the link given by powerlord.
__________________
Krelle1911 is offline
[email protected]
BANNED
Join Date: Nov 2015
Old 01-31-2016 , 09:44   Re: [CSGO] Linux RENICE server
Reply With Quote #6

Quote:
Originally Posted by Krelle1911 View Post
Hi

I'm looking for somone to write a simple updated tutorial on THIS.

I want my servers to be reniced automatically at startup so I dont have to go to htop and do it manually.

I've followed the tutorial on the link but it doesnt seem to work.

Here is my crontab:

And here is my startline:

I am running Ubuntu 14.04 LTS
Code:
*/1 * * * * renice -19 `cat /home/steam/csgo27010/srcds.pid` >/dev/null 2>&1
Code:
./srcds_run -console -game csgo -maxplayers_override 12 +mapgroup mg_bomb +map de_dust2 -exec  server.cfg -ip xxx.xxx.xxx.xxx -port 27010 +exec gamemode_competitive.cfg -usercon +game_type 0 +game_mode 1 -secure -tickrate 128 -pidfile csgo1.pid
in putty paste this
cat /home/steam/csgo27010/csgo1.pid

if you will be see numbers of pid all is ok but if not change access path

maybe to

/home/steam/csgo27010/csgo/csgo1.pid

if you will need help wright mail
i like linux maybe i will be helpful
but noting is for free

Last edited by [email protected]; 01-31-2016 at 09:56. Reason: [email protected]
sourcemodcfg@gmail.com is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 01-31-2016 , 10:31   Re: [CSGO] Linux RENICE server
Reply With Quote #7

Quote:
Originally Posted by Krelle1911 View Post
Code:
*/5 * * * * renice -20 `cat /home/steam/csgo27010/srcds.pid` >/dev/null 2>&1
Quote:
Originally Posted by [email protected] View Post
Code:
*/1 * * * * renice -19 `cat /home/steam/csgo27010/srcds.pid` >/dev/null 2>&1
^

Code:
`pidof srcds_linux`
That one will automatically get all pids of srcds_linux (and changes for all servers, if you run multiple)..

Saves you the hassle of working with the actual pid file.


Quote:
Originally Posted by [email protected] View Post
in putty paste this
cat /home/steam/csgo27010/csgo1.pid

if you will be see numbers of pid all is ok but if not change access path

maybe to

/home/steam/csgo27010/csgo/csgo1.pid

if you will need help wright mail
i like linux maybe i will be helpful
but noting is for free
If you don't bother helping, and only participate in the forums for your own benefit, then stay away.

AlliedModders was built in order to help the community, not to help greedy people like you.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Taner
Member
Join Date: Jun 2009
Old 02-01-2016 , 03:16   Re: [CSGO] Linux RENICE server
Reply With Quote #8

Example for chrt.

Change and test it. After add to root cron.
Code:
chrt -f -p 40 `ps aux | grep srcds_linux | grep xxx.xxx.xxx.xxx | grep 270XX | awk {'print $2'}`
If you want to use chrt change 40 to your wish. 99 is realtime

Last edited by Taner; 02-01-2016 at 03:19.
Taner is offline
Krelle1911
Member
Join Date: Mar 2013
Location: Randers
Old 02-09-2016 , 15:05   Re: [CSGO] Linux RENICE server
Reply With Quote #9

Quote:
Originally Posted by Taner View Post
Example for chrt.

Change and test it. After add to root cron.
Code:
chrt -f -p 40 `ps aux | grep srcds_linux | grep xxx.xxx.xxx.xxx | grep 270XX | awk {'print $2'}`
If you want to use chrt change 40 to your wish. 99 is realtime
So this should be added in cronjob -e under root user even though the srcds servers run on another user?

Also is this how to do it? chrt -f -p 40 `ps aux | grep srcds_linux | grep 123.45.678.9 | grep 270XX | awk {'print $2'}`

where 123.45.678.9 would be the server IP?

And do I have to make a cronjob for all of the gameservers even though they have same IP but different ports?
__________________
Krelle1911 is offline
Taner
Member
Join Date: Jun 2009
Old 02-12-2016 , 11:56   Re: [CSGO] Linux RENICE server
Reply With Quote #10

Quote:
Originally Posted by Krelle1911 View Post
So this should be added in cronjob -e under root user even though the srcds servers run on another user?

Also is this how to do it? chrt -f -p 40 `ps aux | grep srcds_linux | grep 123.45.678.9 | grep 270XX | awk {'print $2'}`

where 123.45.678.9 would be the server IP?

And do I have to make a cronjob for all of the gameservers even though they have same IP but different ports?
Try this. Not sure but this must work for all gameservers with the same ip.
Add or remove more grep if you need.

Create executable and run it:

Code:
for i in `ps aux | grep srcds_linux | grep SERVER-IP | awk {'print $2'}`; do chrt -f -p 55 $i ; done
If test is fine (you can check to PR with top) add executable to root cron every 30min.

I dont have linux or gameservers anymore sorry. You have to test it.

Last edited by Taner; 02-12-2016 at 12:01.
Taner is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode