Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a java server console program that I have configured xinetd to start when connection comes in on a given port and then the program runs in an infinite loop receiving inputstream from telephone exchanges.

The thing is, when a new chunk of stream comes from the exchange xinetd forks a new process each time. I tried setting the wait parameter to yes and restarted the deamon, but no success.

How can I stop this behavior and have the deamon just direct the stream to the process already running? Am I missing something in my config or is it just incorrect?

My config is as follows:

defaults
{
        instances               = 60
        log_type                = SYSLOG authpriv
        log_on_success          = HOST PID
        log_on_failure          = HOST
        cps                     = 50 10
}
includedir /etc/xinetd.d

And then my actual config,

service aos_larmar
{
         socket_type         = stream
         protocol            = tcp
         user                = root
         type                = UNLISTED
         wait                = yes
     instances           = 256
         server              = /home/gunnl/java/start.sh
         port                = 5204
         disable             = no
}

My server OS is
Red Hat Enterprise Linux ES release 4 (Nahant Update 7)

share|improve this question

1 Answer 1

xinetd works by forking a new process for each connection, and the connection is closed when the process ends. If you have a persistent process then you should look at using something like netcat instead.

share|improve this answer
    
Should I then use something like "I nc -l -p 3000" ? –  Gunnlaugur Apr 14 '11 at 18:54
    
Something like: On the receiving computer: nc -l 3141 (netcat, listen on port 3141) and on the sending computer nc -p 3141 (netcat, use port number). –  Hennes Aug 31 '13 at 10:02

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.