The "Devuan" Debian fork
The "Devuan" Debian fork
Posted Nov 30, 2014 17:12 UTC (Sun) by patrakov (subscriber, #97174)In reply to: The "Devuan" Debian fork by mgb
Parent article: The "Devuan" Debian fork
Posted Nov 30, 2014 18:39 UTC (Sun)
by gracinet (guest, #89400)
[Link] (4 responses)
Posted Nov 30, 2014 19:12 UTC (Sun)
by patrakov (subscriber, #97174)
[Link]
Node.js is so far the biggest offender, because it is plain impossible to write a correct UDP-based server in it that works on a multihomed system without resorting to timer-based polling of os.networkInterfaces(). Here "correct" means the following:
1. It must reply from the same of the several IPs belonging to a host where the UDP request came in.
I have expressed the issue in one of the comments to https://github.com/joyent/node/issues/8788 (no IP_FREEBIND, no IP_PKTINFO, no revcmsg/sendmsg (required to actually use IP_PKTINFO), no way to get notified about network configuration changes).
The second, smaller, offender is Python 2.7. It is possible to hack IP_FREEBIND into it (and bind to all "interesting" addresses in advance, even before they appear on interfaces), but not IP_PKTINFO (because of no recvmsg/sendmsg). Also good is that unofficial netlink bindings exist, so one can watch interfaces and IP addresses coming and going without resorting to timer-based polling.
Python 3.3 does have recvmsg/sendmsg support, and IP_PKTINFO can thus be hacked in. Ruby even has ip_pktinfo support out of the box.
Posted Nov 30, 2014 20:20 UTC (Sun)
by cortana (subscriber, #24596)
[Link] (2 responses)
Posted Dec 1, 2014 1:07 UTC (Mon)
by lsl (subscriber, #86508)
[Link] (1 responses)
That should be trivial to do in any programming language, as the file descriptors are just inherited from the parent process. It's there without you doing anything. The count of inherited FDs is passed in the environment (as LISTEN_FDS) and they start at 3.
Sure, there's the sd_listen_fds(3) C API but you don't actually have to use that. Especially not if calling into C involves unholy things like JNI.
Am I missing something?
Posted Dec 1, 2014 4:42 UTC (Mon)
by patrakov (subscriber, #97174)
[Link]
For TCP client sockets, this functionality does exist (new net.Socket([options])), but you can't import an already-existing listening TCP socket by fd. So even for TCP, supportable socket-activation functionality is limited to inetd-style daemons that are executed anew for each incoming connection.
Posted Nov 30, 2014 19:31 UTC (Sun)
by mgb (guest, #3226)
[Link] (1 responses)
A well-designed dependency-based boot manager might have some value on a laptop but production servers cannot rely on trying to guess all the O(N*2) dependencies between components.
Incidentally, all of our systems - servers, VPSs, laptops, and desktops - have one or more inittab entries to bring up serial consoles, maintenance networks, maintenance sshd, etc. Sysvinit tries them and if something fails it waits and tries again.
They work perfectly precisely because they don't rely on systemd-ish human-error-filled notions of trying to specify exactly which network interfaces and file systems need to be up and mounted.
Posted Nov 30, 2014 19:41 UTC (Sun)
by patrakov (subscriber, #97174)
[Link]
And in many contexts (in particular, in clusters where the service depends on something remote) trying and retrying until success is indeed the only working solution. The only possible disagreement here is whether such retrying should be done by the service or by the service manager, but I don't have a strong opinion here.
The "Devuan" Debian fork
The "Devuan" Debian fork
2. It must deal with interfaces going up and down, appearing and disappearing, and the same for their IP addresses. In particular, it must not demand that all "interesting" IP addresses exist on the interfaces at startup time. Bonus points for not requiring to list all potentially-interesting IP addresses explicitly.
The "Devuan" Debian fork
The "Devuan" Debian fork
The "Devuan" Debian fork
The "Devuan" Debian fork
The "Devuan" Debian fork
