I mentioned the exit code too, but i also read another mail after that
stating it does have an error code other then 0 when it exits. You can use
that. (check the other mails about that subject)

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jesse Molina
Sent: donderdag 30 juni 2011 0:14
To: Half-Life dedicated Linux server mailing list
Subject: Re: [hlds_linux] New Replay feature listening on 27040


Follow-up on this issue.

I noticed that css and hl2mp now respect the -strictportbind option too. 
  I've updated my control script.

One thing that I noticed is that unless the -norestart option is also given,
the server will loop forever, trying to start.  This was verified with TF2,
CSS, and HL2MP.  That's not good because of the benchmark going before the
ports resource check and whatnot.  Good thing for the ten second sleep.

I would propose that the desired behavior is that for any startup error, the
error should be given on stderr and an appropriate exit code be given.  The
server process should only restart if it has reached a certain point of
validity, where it can be considered up and running. 
After all, I imagine that the auto-restart function is intended as a crash
recovery option for valid runnable servers.

I guess could always use -norestart in my own control script and write my
own while loop to restart on crashes...  See, this is where exit codes are
useful.  That srcds_run script could trap that easily in the while loop
you've got there.  Oh well, I'll think about it.



l4d and l4d2 do not seem to know about "-strictportbind" yet.  I realize
there is the -fork option that makes it more complicated.  I would just
assume to make the two options incompatible together.



Jesse Molina wrote:
>
> Thank you very much for implementing this. I hope this gets 
> implemented in the other Valve srcds games too.
>
> I've got a host with two IPs and eleven srcds games that could all 
> potentially be running at the same time.
>
> So, I tested by copying one of my TF2 server directories to make a 
> clone of it, started up the first one, then started up the clone.
>
> Here's what the ports in my config file looks like; CLIENTPORT="27013"
> HOSTPORT="27113"
> TVPORT="27213"
> STEAMPORT="26013"
> REPLAYPORT="27413"
>
> The default behavior was that the clone clobbered the next positive 
> incremental available port.
>
> This was on the console;
>
> WARNING: Port 27113 was unavailable - bound to port 27114 instead
> WARNING: Port 27013 was unavailable - bound to port 27014 instead
> WARNING: Port 27213 was unavailable - bound to port 27214 instead
> WARNING: Port 27413 was unavailable - bound to port 27414 instead
> Network: IP 66.113.99.100, mode MP, dedicated Yes, ports 27114 SV /
> 27014 CL
>
> Verified with lsof.
>
>
>
> When I added the "-strictportbind" argument to the command, it did 
> indeed bail out and this was on the console;
>
> ERROR: Port 27113 was unavailable - quitting due to "-strictportbind"
> command-line flag!
>
> "echo $?" returned exit code 100 from srcds_run. As someone else 
> mentioned, exit codes are great for those of us who have written 
> control wrappers.
>
> The command line used was;
>
> sudo -H -u hlds sh -c cd
> /home/hlds/srcds-servers/server-tf2-JMOMOTEST/orangebox ; 
> /home/hlds/srcds-servers/server-tf2-JMOMOTEST2/orangebox/srcds_run 
> -game tf -ip 10.10.99.100 +clientport 27013 +hostport 27113 +tv_port 
> 27213 -steamport 26013 +replay_port 27413 -strictportbind -norestart 
> -pidfile /home/hlds/srcds-servers/server-tf2-JMOMOTEST/server.pid 
> -maxplayers 24
> +map pl_goldrush
>
> One thing to note is that I had to stty sane/reset my terminal after 
> it failed because local echo was messed up. It's not like I normally 
> run it interactively anyway, but that could annoy some noob.
>
>
>
> Steven Hartland wrote:
>> Thanks Jon, just what the doctor ordered :)
>>
>> ----- Original Message ----- From: "Jon Lippincott"
>> <[email protected]>
>>
>>
>>> Good idea.
>>>
>>> I added a check for "-strictportbind." Without this, the engine will 
>>> print a warning, otherwise it will print an error and quit.
>>
>>
>> ================================================
>> This e.mail is private and confidential between Multiplay (UK) Ltd. 
>> and the person or entity to whom it is addressed. In the event of 
>> misdirection, the recipient is prohibited from using, copying, 
>> printing or otherwise disseminating it or any information contained in
it.
>> In the event of misdirection, illegible or incomplete transmission 
>> please telephone +44 845 868 1337 or return the E.mail to 
>> [email protected].
>>
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list 
>> archives, please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlds_linux
>

--
# Jesse Molina
# Mail = [email protected]
# Page = [email protected]
# Cell = 1.602.323.7608
# Web  = http://www.opendreams.net/jesse/



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

Reply via email to