On Mo, 10.02.25 19:09, James Feeney (james@xxxxxxxxxxx) wrote: > I am chasing a bug in the systemd response to the initiation of an > ethernet interface "device" unit by the kernel. When an ethernet > interface "device" unit is initiated by the kernel, systemd will > Start an associated service unit in response, but will subsquently > "Enqueue" that same already running service unit a second time. systemd maintains a queue that merges start requests. So if you enqueue the same unit to be started 5 times you'll end up with just one activation. Unless of course the service exited quickly enough for the later requests to come in later. > Consequently, systemd will forcefully terminate the already running > service unit, and then restart it. After this first "mystery" > restart, the service units then operate as expected. Nah, systemd might terminate services if you tell it so, i.e. bind the lifetime of your service to another unit. > The service units are formatted as shown here: > ---- > After= sys-subsystem-net-devices-%i.device > BindsTo= sys-subsystem-net-devices-%i.device So this means you bind the lifetime of your service to the lifetime if that device unit. Hence, if your device goes away so will yout service. Or in other words: figure out why your device unit goes away. > systemd[1]: Got message type=method_call sender=n/a > destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1 > interface=org.freedesktop.systemd1.Manager member=RestartUnit > cookie=1 reply_cookie=0 signature=ss error-name=n/a > error-message=n/a A client is explicitly asking for the service to be restarted! > The basic question is, why does systemd "enqueue" these running > service units? And, who or what is "sender=n/a", > "member=RestartUnit", which appears to be the intermediary for this > "restart/replace" process? What is the trigger? Why are the udhcp > and the static address service units not effected in the same way? Well, it's not systemd that enqueues those restarts on its own. It's some D-Bus client. use "busctl monitor" to figure out what that might be. you probably have some script or other service thta issues "systemctl restart" on the service. figure out which one that is. Lennart -- Lennart Poettering, Berlin