You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Adding a new symlink to an active unit and reloading systemd can cause that unit's state to be clobbered. In some cases, this can cause systemd to crash.
Steps to reproduce the problem
First create a dummy systemd service, and have it refer to another not-yet-existing service:
systemd will internally create a "not-found" unit to track foobar-b.service. We can see this in systemd-analyze dump:
# systemd-analyze dump
...
-> Unit foobar-a.service:
Description: foobar-a.service
Instance: n/a
Unit Load State: loaded
Unit Active State: active
...
-> Unit foobar-b.service:
Description: foobar-b.service
Instance: n/a
Unit Load State: not-found
Unit Active State: inactive
...
We want foobar-b.service to be ordered afterfoobar-a.service. If it is ordered before, use systemctl daemon-reexec to reinitialize everything, and with luck the hashmap ordering will be different.
Next, we create a link from foobar-b.service to an existing, active service. foobar-a.service is convenient:
systemd version the issue has been seen with
systemd v243
Used distribution
Fedora
Description of problem
Adding a new symlink to an active unit and reloading systemd can cause that unit's state to be clobbered. In some cases, this can cause systemd to crash.
Steps to reproduce the problem
First create a dummy systemd service, and have it refer to another not-yet-existing service:
Make sure the service is loaded and started:
systemd will internally create a "not-found" unit to track
foobar-b.service. We can see this insystemd-analyze dump:We want
foobar-b.serviceto be ordered afterfoobar-a.service. If it is ordered before, usesystemctl daemon-reexecto reinitialize everything, and with luck the hashmap ordering will be different.Next, we create a link from
foobar-b.serviceto an existing, active service.foobar-a.serviceis convenient:When the state for the not-found
foobar-b.serviceis deserialized, it will clobber the state offoobar-a.service:Note that systemd thinks the service is
inactive, even though the main PID is still running!If that main PID exits (e.g.
kill 19170), systemd will hit the assertion:It then freezes execution.
(Also reported against RHEL 7 at https://bugzilla.redhat.com/show_bug.cgi?id=1760149, though that bug report is really originally for a different issue.)
The text was updated successfully, but these errors were encountered: