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?