Hacker News new | ask | show | jobs
by chatmasta 3679 days ago
Does systemd socket activation offer any advantages over xinetd?
3 comments

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.

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.
Yes, it can also support local sockets as well as network sockets.
It has one terrifying disadvantage. The socket is opened and appears to be owned by pid 1.

I haven't seen the code that does this, but my hope is that it is perfect in every way - if not then its an open door from the internet into my server.