-
Notifications
You must be signed in to change notification settings - Fork 29
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
grub-boot-success.timer interfering with greenboot #108
Comments
Going to need more concrete evidence that a brief statement |
I encountered this issue recently, I can provide some details. Package
After user logs in (e.g. with SSH), the timer starts and after 2 minutes the service runs ( The same package provides
It means that: if user logs in during the healthchecks and running healthchecks takes longer than these 2 minutes needed to trigger This is a log I obtained when discovered the issue:
|
To me it looks like |
Further, if |
We can use this as a workaround: |
@LorbusChris I there a way to drop just these two: |
IMO This should be solved by using preset that ensures |
Less clean and less preferable, but also working as you mentioned, would be to mask them, which you might be able to do in osbuild/Image Builder. |
We use masking when testing MicroShift. I'm not sure, but it looks like osbuild might not support masking, only enabling / disabling (which does not work for timers): https://www.osbuild.org/guides/image-builder-on-premises/blueprint-reference.html#systemd-services Unless you have another idea how to handle it? We were also thinking about putting |
On Fedora IoT, this timer is already be disabled by this preset: https://src.fedoraproject.org/rpms/fedora-release/blob/rawhide/f/80-iot-user.preset#_6 This is included in the Doing this via a preset config is the proper way to do it. |
But this is method for Fedora IoT only, right? |
Evaluating ways to do in osbuild-composer also, might require some modifications in the source code. |
The fix PR can be tracked here : osbuild/images#51 |
While I think this is the correct way to do it, this is harder to do for RHEL for Edge because we don't differentiate between RHEL Server and RHEL for Edge. We got into what I think is a similar discussion when we looked into changing It would be great if we could define systemd presets for RHEL for Edge in osbuild itself; this would be akin to what is done in Red Hat CoreOS when that is built. |
So I guess there is a stage for this already? osbuild/osbuild#1269 |
I have been trying to test it with presets in both:
|
@say-paul I'm not an expert on this, but from what I've found it looks like "mask" is different from "disable". I think the main difference is that something that is disabled will still be run if it is a dependency of another service, but if it is masked then it will not be run ever. Is it possible that something in RHEL has declared a dependency on grub-boot-success.timer? |
I have look to that out , fedora-release: https://src.fedoraproject.org/rpms/fedora-release/blob/rawhide/f/fedora-release.spec#_1363 does the same here. @runcom @LorbusChris @nullr0ute any suggestions, on why presets are not working? |
they're likely not working because when the system boots, it has a machine-id already and presets aren't run - this is how osbuild works - the workaround for edge+ignition was to do this https://github.com/osbuild/osbuild-composer/blob/8ff4c0c40af0ee1f25da5336733a5876e5d2b82a/test/data/manifests/rhel_92-x86_64-edge_ami-boot.json#L2396-L2397 which basically adds two more kernel arguments to the system on first boot to mimic firstboot with machine-id. For systems not using ignition (like the fdo case maybe, or normally) we have no way to define "firstboot only kargs to mimic firstboot" so something else has to be thought. Sayan, you can test that presets work by building a rhel for edge artifacts that uses ignition. |
Tried with ignition too, but the service is still active. whats worked is a dropin for grub-boot-success.timer:
|
I think we have to be careful how we word things here. Presets work as expected in Fedora IoT. They are shipped in the When the iot presets are present in an rpm consumed by To me it seems the imperative post-processing for systemd unit activation that ImageBuilder does contradicts the declarative config approach taken elsewhere, e.g. by systemd and ignition. In CoreOS / ostree-native images, the initial presets are applied during Have you thought about shipping the iot presets in the rhel build of the greenboot rpm to avoid the configuring this through ImageBuilder's mechanism or ignition? |
@LorbusChris I tried running |
Just FYI, we made a change in MicroShift's kickstart to manually mask the timer (src):
Not sure if I missed something in the discussion, but you cannot disable/enable timers, you can only mask them. Could that be the reason for problems with presets? |
That's wrong. Creation/deletion of that symbolic link is exactly how systemd enables/disables things.
|
Again, have you considered shipping the preset as part of the RPM? With the preset present at compose time, things should just work, like they do in Fedora IoT |
the preset was not part of the rpm but a stage during commit time.
I understand system presets acts similar to systemctl enable/disable |
In order to add the preset in the RPM for RHEL builds only, you can do something like this in the specfile:
|
@LorbusChris I am inclined to test it if the service can be disabled manually then moving into automating the whole process:
Is this thing working for you as for me its not, I am testing this on rhel 9.2. |
But as far as I understand, for systemd to be be able to enable/disable something, the unit or timer needs to define Am I misunderstanding something? |
You can usually, but not with this specific timer, because it doesn't have an [Install] section on the unit file. The grub rpm creates that symlink for static enablement unconditionally instead of using the usual If you can verify that this issue DOES NOT occur on Fedora IoT, then I think you should try to ship the preset in the rpm and see where that leads. If this also occurs on FIoT in spite of the presets, the proper way to fix this IMO would be to split Symlinking |
@achilleas-k that's correct, I didn't look closely at the timer unit before. See my previous comment. |
We all agree on that, but we need a workaround for now, which is why we ended up talking about masking or adding a drop-in condition for the grub-boot-success.timer to not start if greenboot is running. |
Does this occur on Fedora IoT or not? |
It does. The issue is present in both IoT images built by image builder and I also just checked the official raw image from https://fedoraproject.org/iot/download/ |
Thanks, that means the preset does not work as expected, not even on Fedora IoT where it exists. |
@pmtk yes masking seemes to be an option , the bigger goal will to set it up from the image itself. The solution that worked for me is adding a dropin. |
@LorbusChris Sayan had previously filed - https://bugzilla.redhat.com/show_bug.cgi?id=2229703 Shall we close that as a dupe of yours, since you have baggage attached to your BZ already? |
Wfm |
osbuild/images#51 disables the timer via dropin |
Let's reopen this until the issue is properly fixed on Fedora IoT, too. |
ssh session seems to trigger the grub-boot-success.timer from grub2-tools to set the boot success flag, which means that grub does not decrement the boot counter if there is a reboot.
The text was updated successfully, but these errors were encountered: