Mantas, Thanks for pointing out the relationship between “Accept=yes” in the socket unit and the service unit being a template. I missed that; probably because the service is started
rarely. Kind regards, Ulrich From: Mantas Mikulėnas <grawity@xxxxxxxxx>
On Thu, Dec 5, 2024 at 1:29 PM Windl, Ulrich <u.windl@xxxxxx> wrote:
It technically could watch netlink for that, but likewise you could use
[Socket] FreeBind=yes to avoid the need to wait for the network in the first place. (Also, I'm not sure if netlink events can be filtered, and on servers/routers that run BGP with frequent routing updates it already leads to quite a bit of CPU use from things like networkd or strongswan that try to monitor the whole thing...)
Avoid this nonsense by using
ExecStart=-/opt/omni/lbin/inet.
You specified Accept=yes – explicitly requesting "fork a new process for each connection" mode – which obviously needs a template service so that multiple instances of it could be run for multiple
connections, and the socket 4-tuple becomes the instance parameter to differentiate them.
Does it make sense for a manual 'systemctl start sshd' to also start the network? I'd say Requisite= would make sense, but Wants= a bit less so. (I'm reminded of situations where, if you booted into single-user mode and attempted to start
udev, it would also start everything up to Xorg; it was annoying.) -- Mantas Mikulėnas |