1

I'm using xinetd to provide a simple service, that basically only needs to return a string value.

The service is required to support tcp and udp.

The tcp services looks like this, and works as expected:

service simple-tcp
{
    disable         = no
    type            = UNLISTED
    id              = tcp-service
    socket_type     = stream
    port            = 20
    protocol        = tcp
    user            = nobody
    wait            = no
    server          = /bin/echo
    server_args     = Hello World.
    instances       = 25
    log_on_success  += DURATION HOST
    log_on_failure  += ATTEMPT HOST
    per_source      = 5
}

So I wanted to do the exact same for udp service but I haven't been able to make it work so far.

service udp-service
{
    disable         = no
    type            = UNLISTED
    id              = udp-service
    socket_type     = dgram
    port            = 25
    protocol        = udp
    user            = nobody
    wait            = yes
    server          = /bin/echo
    server_args     = Hello World.
    instances       = 25
    log_on_success  += DURATION HOST
    log_on_failure  += ATTEMPT HOST
    per_source      = 5
}

I realized wait = yes is necessary for udp. Connection gets logged if I send data to the service, but I cannot receive the response. And the log file contains "status=1" which indicates an error. But I have no clue how to narrow this down.

Could anyone explain what is going on and if there is a way to fix this, or another easy approach to just return a string via udp?

soey
  • 111
  • 1
  • 1
    Is there any reason why you do not use the standard *echo* service? – Nils Nov 16 '17 at 20:02
  • using echo would be an overhead and poses a security risk afaik (risk of getting DDOSed). plus i need the service for several ports, and i think with echo I can only bind it to port 7 (the one that is defined in /etc/services, as it uses type INTERNAL) – soey Nov 17 '17 at 08:35

0 Answers0