RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1914575 - grub-boot-success.service should not be started inside systemd-nspawn container
Summary: grub-boot-success.service should not be started inside systemd-nspawn container
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: grub2
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Bootloader engineering team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-09 22:15 UTC by Gena Makhomed
Modified: 2022-05-10 16:57 UTC (History)
3 users (show)

Fixed In Version: grub2-2.02-111.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 15:31:42 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RTT-4193 0 None None None 2022-02-02 18:42:38 UTC
Red Hat Issue Tracker RTT-4194 0 None None None 2022-02-02 18:42:43 UTC
Red Hat Product Errata RHSA-2022:2110 0 None None None 2022-05-10 15:32:26 UTC

Description Gena Makhomed 2021-01-09 22:15:10 UTC
Description of problem:

grub-boot-success.service should not be started inside systemd-nspawn container

Version-Release number of selected component (if applicable):

source: grub2-2.02-90.el8.src.rpm
binary: grub2-tools-2.02-90.el8.x86_64.rpm

How reproducible:

always

Steps to Reproduce:

1. Install RHEL 8.3 / CentOS 8.3

2. install systemd-container package:

dnf install systemd-container

3. create test container:

dnf --installroot=/var/lib/machines/test --releasever=8 install dnf systemd openssh-clients openssh-server passwd vim mc

4. start test container:

machinectl start test

5. enter inside test container:

machinectl shell test

6. create user www inside container:

useradd www

7. set password for user www inside container:

passwd www

8. login to www via ssh inside container:

ssh www@localhost

9. wait two minutes

10. check systemctl status for user www:

systemctl --user

Actual results:

● grub-boot-success.service            loaded failed failed    Mark boot as successful
 grub-boot-success.timer              loaded active elapsed   Mark boot as successful after the user session has run 2 minutes

Expected results:

grub-boot-success.timer should be disabled inside systemd-nspawn containers.

Additional info:

Patch to fix this bug:

# diff -u /usr/lib/systemd/user/grub-boot-success.timer.orig /usr/lib/systemd/user/grub-boot-success.timer
--- /usr/lib/systemd/user/grub-boot-success.timer.orig  2020-09-08 22:00:24.000000000 +0300
+++ /usr/lib/systemd/user/grub-boot-success.timer       2021-01-10 00:11:23.813009897 +0200
@@ -1,5 +1,6 @@
 [Unit]
 Description=Mark boot as successful after the user session has run 2 minutes
+ConditionVirtualization=!systemd-nspawn
 ConditionUser=!@system

 [Timer]

Comment 1 Gena Makhomed 2021-01-10 09:47:45 UTC
Updated patch to fix this bug:

# diff -u /usr/lib/systemd/user/grub-boot-success.timer.orig /usr/lib/systemd/user/grub-boot-success.timer
--- /usr/lib/systemd/user/grub-boot-success.timer.orig  2020-09-08 22:00:24.000000000 +0300
+++ /usr/lib/systemd/user/grub-boot-success.timer       2021-01-10 00:11:23.813009897 +0200
@@ -1,5 +1,6 @@
 [Unit]
 Description=Mark boot as successful after the user session has run 2 minutes
+ConditionVirtualization=!container
 ConditionUser=!@system

 [Timer]

Comment 2 Robbie Harwood 2021-09-09 21:52:17 UTC
Hi,

> grub-boot-success.timer should be disabled inside systemd-nspawn containers.

Could you please indicate what the problem with it is?  That is, what is breaking for you?

Comment 3 Gena Makhomed 2021-09-10 06:32:11 UTC
> Could you please indicate what the problem with it is?  That is, what is breaking for you?

"systemctl --user" command show failed service run:


● grub-boot-success.service            loaded failed failed    Mark boot as successful
 grub-boot-success.timer              loaded active elapsed   Mark boot as successful after the user session has run 2 minutes


it is breaking systemd service monitoring for me.

failed service means what something is wrong with system and it should be repaired. 

fix is trivial:

# diff -u /usr/lib/systemd/user/grub-boot-success.timer.orig /usr/lib/systemd/user/grub-boot-success.timer
--- /usr/lib/systemd/user/grub-boot-success.timer.orig  2020-09-08 22:00:24.000000000 +0300
+++ /usr/lib/systemd/user/grub-boot-success.timer       2021-01-10 00:11:23.813009897 +0200
@@ -1,5 +1,6 @@
 [Unit]
 Description=Mark boot as successful after the user session has run 2 minutes
+ConditionVirtualization=!container
 ConditionUser=!@system

 [Timer]

Comment 4 Gena Makhomed 2021-09-11 16:28:28 UTC
P.S. This bug already fixed if Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1914571

$ cat /usr/lib/systemd/user/grub-boot-success.timer
[Unit]
Description=Mark boot as successful after the user session has run 2 minutes
ConditionUser=!@system
ConditionVirtualization=!container

[Timer]
OnActiveSec=2min

Comment 11 errata-xmlrpc 2022-05-10 15:31:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Low: grub2 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:2110


Note You need to log in before you can comment on or make changes to this bug.