Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1988457

Summary: [RHEL8.4/Leapp/Bug] Broken systemlinks in /etc/systemd/system
Product: Red Hat Enterprise Linux 7 Reporter: Rajesh Dulhani <rdulhani>
Component: leapp-repositoryAssignee: mmatuska
Status: CLOSED ERRATA QA Contact: Upgrades and Supportability <upgrades-and-supportability>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.9CC: amepatil, mkluson, mmacura, mreznik, peter.vreman, pstodulk
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: leapp-repository-0.17.0-3.el7_9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-17 15:00:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rajesh Dulhani 2021-07-30 15:18:59 UTC
Description of problem:

After upgrading from 7.9 to 8.4 with leapp there are many broken symlinks in /etc/systemd/system from old rhel7 systemd units that do not exists anymore on rhel8

~~~
root@rhel84:~# find /etc/systemd -type l | while read l; do echo "$l $(readlink $l) $(test -e $l || echo "BROKEN")"; done | grep BROKEN
/etc/systemd/system/multi-user.target.wants/brandbot.path /usr/lib/systemd/system/brandbot.path BROKEN
/etc/systemd/system/multi-user.target.wants/rhel-configure.service /usr/lib/systemd/system/rhel-configure.service BROKEN
/etc/systemd/system/default.target.wants/systemd-readahead-replay.service /usr/lib/systemd/system/systemd-readahead-replay.service BROKEN
/etc/systemd/system/default.target.wants/systemd-readahead-collect.service /usr/lib/systemd/system/systemd-readahead-collect.service BROKEN
/etc/systemd/system/system-update.target.wants/systemd-readahead-drop.service /usr/lib/systemd/system/systemd-readahead-drop.service BROKEN
/etc/systemd/system/sysinit.target.wants/rhel-autorelabel.service /usr/lib/systemd/system/rhel-autorelabel.service BROKEN
/etc/systemd/system/sysinit.target.wants/rhel-autorelabel-mark.service /usr/lib/systemd/system/rhel-autorelabel-mark.service BROKEN
/etc/systemd/system/sysinit.target.wants/rhel-domainname.service /usr/lib/systemd/system/rhel-domainname.service BROKEN
/etc/systemd/system/sysinit.target.wants/rhel-import-state.service /usr/lib/systemd/system/rhel-import-state.service BROKEN
/etc/systemd/system/sysinit.target.wants/rhel-loadmodules.service /usr/lib/systemd/system/rhel-loadmodules.service BROKEN
/etc/systemd/system/basic.target.wants/rhel-dmesg.service /usr/lib/systemd/system/rhel-dmesg.service BROKEN
/etc/systemd/system/local-fs.target.wants/rhel-readonly.service /usr/lib/systemd/system/rhel-readonly.service BROKEN
[crash/LI] root@li-lc-2432:~#
~~~

Most of them come from initscripts in RHEL7.9:
~~~

$ rpm -q initscripts
initscripts-9.49.53-1.el7_9.1.x86_64


$ rpm -qlv initscripts | grep /usr/lib/systemd/system
-rw-r--r--    1 root    root                      160 May 22  2020 /usr/lib/systemd/system/brandbot.path
-rw-r--r--    1 root    root                      116 May 22  2020 /usr/lib/systemd/system/brandbot.service
-rw-r--r--    1 root    root                      410 May 22  2020 /usr/lib/systemd/system/rhel-autorelabel-mark.service
-rw-r--r--    1 root    root                      459 May 22  2020 /usr/lib/systemd/system/rhel-autorelabel.service
-rw-r--r--    1 root    root                      408 May 22  2020 /usr/lib/systemd/system/rhel-configure.service
-rw-r--r--    1 root    root                      217 May 22  2020 /usr/lib/systemd/system/rhel-dmesg.service
-rw-r--r--    1 root    root                      331 May 22  2020 /usr/lib/systemd/system/rhel-domainname.service
-rw-r--r--    1 root    root                      450 May 22  2020 /usr/lib/systemd/system/rhel-import-state.service
-rw-r--r--    1 root    root                      437 May 22  2020 /usr/lib/systemd/system/rhel-loadmodules.service
-rw-r--r--    1 root    root                      401 May 22  2020 /usr/lib/systemd/system/rhel-readonly.service
~~~

The readahead was part of systemd in RHEL7.9:
~~~

$ rpm -qlv systemd | grep /usr/lib/systemd/system/systemd-readahead
-rw-r--r--    1 root    root                      845 Jan 15  2021 /usr/lib/systemd/system/systemd-readahead-collect.service
-rw-r--r--    1 root    root                      642 Jan 15  2021 /usr/lib/systemd/system/systemd-readahead-done.service
-rw-r--r--    1 root    root                      635 Jan 15  2021 /usr/lib/systemd/system/systemd-readahead-done.timer
-rw-r--r--    1 root    root                      555 Jan 15  2021 /usr/lib/systemd/system/systemd-readahead-drop.service
-rw-r--r--    1 root    root                      757 Jan 15  2021 /usr/lib/systemd/system/systemd-readahead-replay.service
~~~


Version-Release number of selected component (if applicable):
leapp-0.12.1-1.el7_9.noarch
leapp-repository-0.14.0-4.el7_9.noarch



Reproducer:

- Always, whenever we upgrade it.
- Upgrade RHEL7.9 to 8.4 using leapp
- Find broken symlinks in /etc/systemd

Result:

- Broken symlinks to non-existing RHEL7 systemd unit exists

Expected results:

- No broken symlinks should be present.
- Base OS files from initscripts and systemd RPMs dynamic created files (like the symlinks of the enabled services) are cleaned up

Comment 5 Petr Stodulka 2022-11-16 15:19:27 UTC
Should be fixed by the upstream PR:
 - https://github.com/oamg/leapp-repository/pull/972

Comment 10 errata-xmlrpc 2023-05-17 15:00:24 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 (leapp and leapp-repository 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/RHBA-2023:3187