Hacker News new | ask | show | jobs
by justinsaccount 3682 days ago
Afaik something like xinetd forks and execs a copy of the daemon for each connection and communicates over stdin/stdout.

This can work for simple services like sshd which fork for each connection anyway, but would never work for something like nginx or redis.

2 comments

That is untrue. Read about "wait"/"nowait" (in the xinetd and inetd manuals, for starters).
Ah, I must have been thinking of something like

https://cr.yp.to/ucspi-tcp/tcpserver.html

Then you'll enjoy reading about the nosh toolset and s6-networking, which both separate the listen-accept model into separate programs and have the ability to invoke "wait" servers with the listening socket.

* http://homepage.ntlworld.com./jonathan.deboynepollard/Softwa... * http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/UC... * http://skarnet.org/software/s6-networking/

Avoiding extra processes is good, but it's not the end of the world to exec netcat.