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

XSI-1773 clean up swtpm service files #6193

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

lindig
Copy link
Contributor

@lindig lindig commented Dec 20, 2024

We have seen swtpm systemd service files not being removed. We now make Fe_systemctl.stop callable when the servive is potentially not running to ensure clean up is happening regardless.

@lindig lindig force-pushed the private/christianlin/XSI-1773 branch from cace65f to 3e2f3f4 Compare December 20, 2024 14:09
Copy link
Member

@psafont psafont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fe_systemctl.stop unlinks the service file, if it exists.

@psafont
Copy link
Member

psafont commented Dec 20, 2024

This might not be enough for all cases, but probably covers most of them. Do we need to clean up before creating a service?

@@ -619,15 +619,14 @@ module SystemdDaemonMgmt (D : DAEMONPIDPATH) = struct
match (of_domid domid, is_running ~xs domid) with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (existing code) is makes some unnecessary calls, as is_running also calls of_domid internally. And now we don't even care about the result of is_running in the systemd case. So better would be to drop is_running from the match and call Compat.is_running ~xs domid in the None case below.

Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a good fix, but we can easily make it more efficient too.

We have seen swtpm systemd service files not being removed. We now call
Fe_systemctl.stop even when the servive is potentially not running to
ensure clean up is happening regardless.

Signed-off-by: Christian Lindig <[email protected]>
@lindig lindig force-pushed the private/christianlin/XSI-1773 branch from 3e2f3f4 to 3d394e0 Compare December 20, 2024 14:41
@lindig lindig added this pull request to the merge queue Dec 20, 2024
Merged via the queue into xapi-project:master with commit 9eeb1f3 Dec 20, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants