bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Re: [PATCH] Inetd and test scripts


From: Ludovic Courtès
Subject: [bug-inetutils] Re: [PATCH] Inetd and test scripts
Date: Thu, 04 Nov 2010 00:03:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hello,

Mats Erik Andersson <address@hidden> writes:

[...]

>> > +# Check that the port is still available
>> > +netstat -na | grep -q "^$PROTO .*$PORT "
>> > +if test $? -eq 0; then
>> > +    echo "Desired port $PORT/$PROTO is already in use."
>> > +    exit 1
>> > +fi
>> 
>> This breaks because ???netstat??? may not be in $PATH; in particular, it
>> breaks the Hydra builder: <http://hydra.nixos.org/build/727555>.
>
> True. Will be changed.

Now, ‘netstat’ isn’t provided by Inetutils, so it’ll have to be
‘AC_PATH_PROG’d, and the test will have to be skipped if it isn’t
found.

Furthermore, it may be that not all ‘netstat’ implementations behave
equally.  On GNU/Linux ‘netstat’ is typically the one provided in Linux
net-tools; does it behave the same as on OpenBSD, etc.?

>> Furthermore, I think it???s useless: if ???inetd??? fails to listen on $PORT,
>> the remainder of the script will notice it anyway.
>
> Not at all. How do you then tell which part was failing: Inetd or Tftpd.

For ‘tftp.sh’, it doesn’t matter which one is failing.  It’s a tftp{,d}
test.  If something fails on the way, what matters is that the test
actually fails.

However, I agree that ‘inetd’ alone should be tested as well.  There’s
should be a different test for that, ideally a lower-level one, possibly
treating ‘inetd’ as a white box.

>> > +# Wait somewhat for the service to settle
>> > +sleep 1
>> 
>> Pointless.
>
> On the contrary, GNU/Linux was so quick to proceed that the test failed.
> Again, robustness and predictable behaviour.

Then we have a problem.  Under load, on a slower (virtual) CPU, etc., 1s
may not be enough.

In daemon mode, I’d expect ‘inetd’ would fork in the background only
once it’s read the config file and is actually listening where it needs
to.  If that is the case, then the ampersand can be removed and
synchronization should be perfect.  (That implies running inetd without
‘-d’.)

Speaking of which, why that:

-$INETD "${VERBOSE:+-d}" "$INETD_CONF" &
+$INETD -d "$INETD_CONF" &
Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]