[Dnsmasq-discuss] patch to support systemd socket activation
sfzhi at yahoo.com
Thu Nov 17 19:02:22 GMT 2011
On 2011-11-15 10:01, Jan Seiffert wrote:
> 2011/11/14 Michael Stapelberg<michael+dnsmasq at stapelberg.de>:
>> Hi Simon,
>> Excerpts from Simon Kelley's message of 2011-11-14 20:15:25 +0000:
>>> I'm not a systemd expert, by any means, (I didn't write the code above)
>>> but I'd like to understand the advantages and problems with the two
>>> methods of activation (DBus and socket)
>> Well, the socket activation version would offer the same benefits as the DBus
>> activation does, but also in case you don’t want to use DBus :). Not sure how
>> relevant the usecase is or if 微菜 is just not aware of the DBus activation.
> I'm also no expert on systemd, never understood the whole frills about
> it. But AFAIK socket activation is a kind of inetd thingy.
> It's inspired by MacOS. Normaly a Linux desktop starts one million
> Daemon in the Background because the user might need them (Cups, etc).
> Socket activation only starts the service the first time their Socket
> is used. So if you do not Print that day, cups wouldn't be startet.
> But this is IMHO an utter fail for dnsmasq.
> Esp. i think DHCP can not work this way.
The whole fuzz about systemd is mostly just a matter of fashion. There are some good ideas in its design, but the one of socket activation, IMO, is blown up to the point of being ridiculous. Everyone seems to be adding socket activation support to their applications just because everyone else is doing that. I think dnsmasq is a good example of an application that would *not* benefit from such an addition. TFTP support in dnsmasq is intentionally limited (correct me if I'm wrong). It is meant mostly to facilitate network boot, which usually also involves DHCP/BOOTP. So having TFTP socket activation without DHCP would not be very useful in practice. DNS and DHCP (the latter to a lesser extent) are typically used quite often, so in many situations socket activation would only postpone starting the daemon by a few minutes. Moreover, dnsmasq does not use that much memory and it runs fine even on resource-constrained systems where one would not want to have systemd around at all.
In other words, I don't think dnsmasq needs socket activation.
More information about the Dnsmasq-discuss