0

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)

Hennes
  • 64,768
  • 7
  • 111
  • 168
Gunnlaugur
  • 143
  • 1
  • 4

1 Answers1

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.

Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
  • 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