Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have have installed xinetd, and I wrote a script:

#!/bin/bash
echo "Some text"
touch /home/somefile

I made a service configuration under /etc/xinetd.d/ and basically it works when I connect to localhost under the configured port, because: The file somefile gets generated by the touch command on connection to the service. I connect with telnet:

telnet localhost someport

What I don't understand is that telnet does not output the string "Some text". What can I do to make this work?

Heres the xinetd service configuration file in /etc/xinetd.d/:


# This is the configuration for the tcp/stream echo service.

service my_service_name #not in /etc/services
{
# This is for quick on or off of the service
        disable         = no

# The next attributes are mandatory for all services
        id              = my_custom_id
        type            = UNLISTED
        wait            = yes
        socket_type     = stream
        protocol        = tcp

# External services must fill out the following
        user            = root
#       group           =
        server          = /usr/bin/program_name_here
#       server_args     =

# External services not listed in /etc/services must fill out the next one
        port            = 60001
}
share|improve this question
    
Can you include your xinetd service configuration? Your script works fine for me. –  Steven D Sep 23 '14 at 8:34
    
Thanks for your reply. I added the configuration file content. –  fes Sep 24 '14 at 19:34

1 Answer 1

up vote 1 down vote accepted

Changing wait to no will likely solve your problem. From the man page:

If its value is yes, the service is single-threaded; this means that xinetd will start the server and then it will stop handling requests for the service until the server dies and that the server software will accept the connection.

The key bit there is that when wait is set to yes, the server software is expected to accept the connection, which your script does not do.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.