xinetd problem
Paul J. Lucas
yellowdog-general@lists.terrasoftsolutions.com
Wed Mar 26 00:18:01 2003
So, for a small UDP daemon I wrote, it seems as though xinetd is
showing an old bug again. Do a Google search for:
"select reported EBADF but no bad file descriptors"
(look in both Web and Groups). The problem was supposedly
fixed a while ago. However, perhaps it was fixed only for TCP,
not UDP. The xinetd config file is:
service ssdp
{
id = ssdp-rio
type = UNLISTED
port = 21075
socket_type = dgram
protocol = udp
server = /usr/local/sbin/rio-ssdp
server_args = -i -l -n 10.0.1.201 -p 82
user = nobody
wait = yes
}
The server code for running under inetd is trivial and roughly
(in Perl):
$client = recv( STDIN, $request, 80, 0 );
send( STDOUT, "hello, world!\n", 0, $client );
Test client code is:
#! /usr/bin/perl
use IO::Socket;
$sock = IO::Socket::INET->new(
PeerAddr => '10.0.1.201',
PeerPort => 21075,
Proto => 'udp',
Type => SOCK_DGRAM,
);
$sock->send( "hello?" );
$sock->recv( $response, 80, 0 );
print $response;
You can try this out by installing the conf file, HUP'ing
xinetd, and trying the client. Then wait maybe half an hour.
Then try again. You'll get the "select reported EBADF but no
bad file descriptors" in /var/log/messages and xinetd will stop
responding to the port.
If this kind of this is beyond the scope of this mailing list,
anybody know how I can find out the maintained for xinetd?
Thanks.
- Paul