Xinetd starting a daemon and redirecting
I want to forward xinetd connection to another local port (say 12345). I based my solution on CentOS/Redhat documentation Chapter 17. [TCP Wrappers and xinetd, article 17.4.3.3]. In the example the configuration starts a daemon and also redirects the traffic to a host: port. The doco say it should be able to forward to different port on the same system too.
My current goal is to starts a daemon (say testsmpp) at any connection on port 12345 and redirect the stream to a particular port (say 54321). The tricky bit is I don't want the daemon (testsmpp) to read from STDIN, instead it should be able to read from the port where the xinetd is forwarding the traffic to. I created a service under /etc/service e.g Code:
testsmpp 12345/tcp Code:
service testsmpp Is server and redirect tags are mutually exclusive? I looked at the discussion about xinet forking concurrent server but my motivation are slightly different. I want to listen for incoming connection on another port as the other application will communicate with the daemon on that port too in a distributed computing environment. Any clues much appreciated. |
I believe the redirect needs to have an IP address i.e.
redirect = 127.0.0.1 54321 |
Quote:
I just found from the xinetd.conf man pages that if both the 'redirect' and 'server' attributes are present, 'redirect' attribute takes priority. So the binary specified with 'server' attribute will not start and I am observing exactly that. It sort of prevents me from achieving what I originally wanted to. I wanted to start testsmpp bound to a predefined port (say 54321) by the xinetd and redirect traffic to that port. Is it achievable? Any other suggestions? |
why not just specify the port with "port=54321"
|
Quote:
The service listens to 12345 and any connection made to that port should be forwarded to 54321. |
All times are GMT -5. The time now is 06:55 AM. |