Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 134445

Summary: HLDS INIT SCRIPT : server cannot be stopped
Product: Gentoo Linux Reporter: kelux <lfpmix>
Component: [OLD] GamesAssignee: Gentoo Games <games>
Status: RESOLVED DUPLICATE    
Severity: minor    
Priority: High    
Version: 2006.0   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description kelux 2006-05-26 11:58:11 UTC
Hello,

There is a minor problem in the init script that comes with the hlds ebuild.

In fact you can start the hlds server, but you cant stop it, 'cause of wrong process's pid.

Here is some explanation :

When you start the server , one PID is for the /bin/sh command who runs the srcds_run executable. And then there is a child PID for the real executable :

games    4693    1  0 20:43 ?   00:00:00 /bin/sh /opt/halflife/css/srcds_run -pidfile /var/run/hlds.pid

games    4708  4693 88 20:43 ?  00:00:03 ./srcds_amd -pidfile /var/run/hlds.pid

In /var/run/hlds.pid we find the Child pid, in that example 4708.

When want to stop the process with the rc script, it kills the child process but not the Parent. We can see with ps -ef that a new child process is created :

games     4748  4693  0 20:50 ?  00:00:00 sleep 10

Then it disappears and the server is restarted :

games     4750  4693 99 20:50 ?  00:00:02 ./srcds_amd -pidfile /var/run/hlds.pid

Then you can't stop again the process, cause the PID had changed ...

So you must kill the child and the parent process by hand in order to stop "properly" the hlds server.

The only issue is that i dont use the rc script and i run from the CLI a script who do that (i must switch to games user just before).

Is there an issue to fix the init script ? in order to kill both parent and child process... i would like to use the rc script :)

Cheers.

Luc
Comment 1 Tristan Heaven (RETIRED) gentoo-dev 2006-09-27 03:53:43 UTC

*** This bug has been marked as a duplicate of 123930 ***