Bug 2338142

Summary: alternatives is unhappy when a file is moved from /usr/sbin to /usr/bin
Product: [Fedora] Fedora Reporter: Zbigniew Jędrzejewski-Szmek <zbyszek>
Component: chkconfigAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 42CC: jamacku, lnykryn, msekleta, yaneti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: chkconfig-1.32-1.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-03-15 00:44:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2267022    

Description Zbigniew Jędrzejewski-Szmek 2025-01-15 10:46:31 UTC
Caused by https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin.
When rpm payload migrates from /usr/sbin to /usr/bin, if we change
the scriptlets from 'update-alternatives /usr/sbin/foo …' to
'update-alternatives /usr/bin/foo …', alternatives complains and actually
seems to remove all symlinks. On upgrades we somehow end up with no
symlinks at all.

See the discussion in https://src.fedoraproject.org/rpms/iptables/pull-request/10.

For iptables, PR10 essentially reverts the sbin merge for the affected files. They are kept under /usr/sbin. As discussed in the patch, this will prevent upgraded systems from being fully merged, but otherwise should be mostly OK. But in the long run we need to figure out a better solution. One option is to duplicate the alternatives calls for /usr/bin and /usr/sbin and somehow make alternatives work on upgraded systems. The other option would be make alternatives aware of the merge and treat /usr/sbin and /usr/bin as equivalent. 

Reproducible: Always

Comment 2 Yanko Kaneti 2025-01-16 14:46:31 UTC
FWIW. Starting with todays https://src.fedoraproject.org/lookaside/rpm-specs-latest.tar.xz

$ grep alternatives *.spec -l  | xargs grep _sbindir  -l | wc -l
93

Comment 3 Aoife Moloney 2025-02-26 13:24:15 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.

Comment 4 Fedora Update System 2025-03-13 16:39:22 UTC
FEDORA-2025-611b8a3c68 (chkconfig-1.32-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-611b8a3c68

Comment 5 Fedora Update System 2025-03-14 04:32:13 UTC
FEDORA-2025-611b8a3c68 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-611b8a3c68`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-611b8a3c68

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2025-03-15 00:44:11 UTC
FEDORA-2025-611b8a3c68 (chkconfig-1.32-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.