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

systemd-sysext.service.d: add drop-in for OEM partition mount actions #69

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

pothos
Copy link
Member

@pothos pothos commented Apr 14, 2022

When systemd-sysext sets up the new /usr mount, the OEM partition
remains mounted but the mount point is not visible anymore. This breaks
access to grub.cfg, oem-release, and any OEM tools.
Add a drop-in for the systemd-sysext service to first unmount the OEM
partition to prevent stale mounts from piling up that cause the
usr-share-oem.mount unit to fail on stop, and then mount the OEM
partition again when systemd-sysext did its work. At the moment a
"ExecStopPre" action does not exist in systemd and luckily is not
needed because systemd-sysext removes the OEM mount together with the
overlay mounts. The lazy unmount makes it possible to unmount while a
process from the OEM tools is running.

How to use

Check whether the OEM remount interferes with the OEM tool startup

Testing done

Manually restarted systemd-sysext on Azure (process kept running), on GCE (couldn't test because GCE is broken at the moment, see Jeremi's PRs for the fix) and on VMware ESX (process kept running). The remount on boot was finished before the OEM services started.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
    ↑ TODO in c-o

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 14, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 14, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
@pothos pothos self-assigned this Apr 14, 2022
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 22, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
@@ -0,0 +1,12 @@
[Unit]
Before=oem-gce.service waagent.service amazon-ssm-agent.service vmtoolsd.service nvidia.service
Copy link
Member

@jepio jepio Apr 22, 2022

Choose a reason for hiding this comment

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

I don't understand why this is necessary - systemd-sysext is a Before=sysinit.target service so these should already be ordered correctly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's not necessary at the moment, it's more a precaution in case DefaultDependencies=no would be used in one of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it would be good to have even if this workaround won't be needed for too long hopefully. I can add a comment.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe you could also document how did you come up with this list?

Copy link
Member Author

@pothos pothos Apr 22, 2022

Choose a reason for hiding this comment

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

Actually it is required for oem-gce-enable-oslogin.service to prevent having it fail.

Yes, added coreos-overlay:coreos-base/oem-*/files/units/*service as a hint

@pothos pothos requested a review from a team April 22, 2022 08:42
@pothos pothos marked this pull request as ready for review April 22, 2022 08:42
@@ -0,0 +1,12 @@
[Unit]
Before=oem-gce.service waagent.service amazon-ssm-agent.service vmtoolsd.service nvidia.service
Copy link
Member

Choose a reason for hiding this comment

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

Maybe you could also document how did you come up with this list?

When systemd-sysext sets up the new /usr mount, the OEM partition
remains mounted but the mount point is not visible anymore. This breaks
access to grub.cfg, oem-release, and any OEM tools.
Add a drop-in for the systemd-sysext service to first unmount the OEM
partition to prevent stale mounts from piling up that cause the
usr-share-oem.mount unit to fail on stop, and then mount the OEM
partition again when systemd-sysext did its work. At the moment a
"ExecStopPre" action does not exist in systemd and luckily is not
needed because systemd-sysext removes the OEM mount together with the
overlay mounts. The lazy unmount makes it possible to unmount while a
process from the OEM tools is running. In the future we can try to
move the OEM mountpoint under /mnt or /run and make /usr/share/oem a
symlink to it.
@pothos pothos merged commit 40af7f1 into flatcar-master Apr 25, 2022
@pothos pothos deleted the kai/sysext-oem-partition branch April 25, 2022 04:09
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 25, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 25, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 25, 2022
This pulls in flatcar/init#69
to restore the OEM partition mount point after the /usr overlay is
done.
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