[bf1942] Map change process leak with 1.6rc2

AthlonRob AthlonRob at axpr.net
Sat Feb 7 22:36:03 EST 2004


On Sat, 2004-02-07 at 09:41, Steven Hartland wrote:

> On a similar note the win32 dedicated server breaks
> looping scripts e.g.
> ===SCRIPT===
> @echo off
> :10
> BF1942_w32ded.exe
> rem goto 10
> ===SCRIPT===

I'd hardly call a batch file a 'script' ... but okay.  :-)

It's been a while since I did anything significant with batch files, but
as I recall, "rem goto 10" does absolutely nothing.  ;-)

> The above is a very simple example which does nothing apart
> from restart the server on crash but we use a more complex one
> which does more, such as email notification and stats. With the
> new 1.6 this fails, as on map change the original process quits
> completely leaving a new process with ppid = 0. This makes it
> look like a server failure the result is that a new server is started
> on each map change the result being a n - 1 servers running
> ( n = number of map changes ).

Well, I don't know how you'd do this on Windows (maybe with some cygwin
tools?), but in Linux I'd rewrite the above batch file as:

#!/bin/sh
while (pgrep bf1942 > /dev/null); do
   /path/to/bf1942_lnxded
   sleep 2
done

...and work with that to do all the fancy-schmantzy stuff you want to
do.  :-)

GOTO's are very ugly, BTW.

Rob




More information about the Bf1942 mailing list