Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134445 - HLDS INIT SCRIPT : server cannot be stopped
Summary: HLDS INIT SCRIPT : server cannot be stopped
Status: RESOLVED DUPLICATE of bug 123930
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-26 11:58 UTC by kelux
Modified: 2006-09-27 03:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***