Starting hlds with PID
Hello, everybody!
I want to know how to start my server with predefined PID? I tried with -pidfile pid.pid, where in pid.pid there is the predefined PID, but it doesn't work. pid.pid file is located in the same directory as hlds and the starting script. Any suggestions how to make it? Thanks in advance. |
Re: Starting hlds with PID
please explain why you need this
it's a very bad practice to do this, pids are supposed to be random just tell what you need it for, I'm pretty sure it can be made in another way |
Re: Starting hlds with PID
I want to use Monit to monitor my servers. So if one server has crashed with 100% cpu usage, monit will restart it, but Monit works with PID. :)
|
Re: Starting hlds with PID
I think PID is a system process identificator, you can't submit your own.
Everything you can do is to start a process andget it's PID for monitoring. P.S. I've never seen server crashed due to 100% CPU. You'll get FPS around 4.00 but not crash :) |
Re: Starting hlds with PID
So you have never seen anything :)
Some buggy plugin crashes the server and it starts using 100% cpu. So, I still think there is a way to set pid, should be, so anyone help? |
Re: Starting hlds with PID
The only thing that you can do is start the server and get the PID that was given to it by the operating system. There's no reason to want to do it any other way.
|
Re: Starting hlds with PID
I use Monit too and everything is working fine using -pidfile
|
Re: Starting hlds with PID
Quote:
./hlds_run -game cstrike +ip -port -pidfile pid.pid +rcon_password .... and file pid.pid is located where starting script is located. I tried also to give full path, but same. @fysiks If there is a way monit to get the PID of started server, OK, tell me how to make it. EDIT: Aha, I tried with --pidfile /full/path and it works :) EDIT 2: Now I understand, it is not predefined PID, --pidfile option just writes the pid of the started server in a file, so everytime when i start the server, the PID is different. And Monit read that pid file and knows which process is the server :) Now i should think about start/stop/restart script, any ideas here ? :) |
Re: Starting hlds with PID
Quote:
example PHP Code:
|
Re: Starting hlds with PID
@aron9forever, yeah, but do you know how Monit works :)
|
| All times are GMT -4. The time now is 14:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.