Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add After=dbus.service to containerd.service #10798

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

benjaminp
Copy link
Contributor

containerd launches runc, which communicates via dbus with systemd to start transient units. Thus, containerd should have an After dependency on dbus.service to prevent dbus from being shut down concurrently with containerd.

@k8s-ci-robot
Copy link

Hi @benjaminp. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dosubot dosubot bot added the area/runtime Runtime label Oct 8, 2024
@AkihiroSuda
Copy link
Member

/ok-to-test

@AkihiroSuda AkihiroSuda added cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Oct 17, 2024
@AkihiroSuda
Copy link
Member

CI failing

 Version '2022.02-3ubuntu0.22.04.2' for 'ovmf' was not found

Please try rebasing

@benjaminp
Copy link
Contributor Author

I've now rebased.

containerd launches runc, which communicates via dbus with systemd to start transient units. Thus, containerd should have an `After` dependency on `dbus.service` to prevent dbus from being shut down concurrently with containerd.

Signed-off-by: Benjamin Peterson <[email protected]>
@dmcgowan dmcgowan added this pull request to the merge queue Oct 17, 2024
Merged via the queue into containerd:main with commit ce265ff Oct 17, 2024
62 checks passed
@benjaminp benjaminp deleted the patch-1 branch October 18, 2024 20:51
@austinvazquez austinvazquez added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Nov 20, 2024
@champtar
Copy link
Contributor

champtar commented Dec 5, 2024

I don't think this is needed, containerd.service has an implicit After=basic.target (see systemctl show containerd -p After), and dbus has an explicit Before=basic.target (systemctl cat dbus | grep Before)
EDIT: on EL9, on EL8 dbus has no Before

@VannTen
Copy link

VannTen commented Dec 5, 2024

sidenote: the same thing can be said for local-fs.target, it is implied in basic.target (see the graphic in man 7 bootup)

@benjaminp
Copy link
Contributor Author

I don't think this is needed, containerd.service has an implicit After=basic.target (see systemctl show containerd -p After), and dbus has an explicit Before=basic.target (systemctl cat dbus | grep Before) EDIT: on EL9, on EL8 dbus has no Before

The upstream dbus service file does not have a Before dependency on basic.target. As you've noted, some distributions or distribution versions add this Before. It's safest for the containerd.service to be explicit for the lowest common denominator.

@VannTen
Copy link

VannTen commented Dec 5, 2024 via email

@benjaminp
Copy link
Contributor Author

As the PR request message notes, the need for this dependency most is most acutely demonstrated in practice during shutdown. It's undesirable to have dbus shut down when containerd is still managing runc containers.

@VannTen
Copy link

VannTen commented Dec 5, 2024 via email

@champtar
Copy link
Contributor

champtar commented Dec 6, 2024

Actually EL9 / Fedora use dbus-broker (https://github.com/bus1/dbus-broker/blob/main/src/units/system/dbus-broker.service.in) and not the original dbus, thus the difference in unit files.
After=dbus.service is indeed needed for distro using the original dbus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime Runtime cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch ok-to-test size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants