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.
Description of problem:
post script of systemd forcily append of `systemd` in following databases
- passwd
- group
While the behavior make sense for initial installation, but not necessary for upgrade. Some customers need to use their own nsswitch.conf, and would not want it to be modified by systemd upgrade script.
Quote Pavel Březina from https://bugzilla.redhat.com/show_bug.cgi?id=1577250#c7> Do you actually need to run it during upgrade?
> Wouldn't it be sufficient to run it only during first installation?
Version-Release number of selected component (if applicable):
systemd-250-12.el9_1.1.x86_64
How reproducible:
always
Steps to Reproduce:
1. Edit /etc/nsswitch.conf, and make the passwd line become:
passwd: sss files
2. Upgrade systemd
3. grep passwd /etc/nsswitch.conf
Actual results:
systemd is forcibly appended
passwd: sss files systemd
Expected results:
the passwd line is untouched
passwd: sss files
Additional info:
Work around:
Instead of removing systemd keywords, comment them out like
passwd: files sss # systemd
group: files sss # systemd
================ systemd post script
# rpm -q --scripts systemd-libs
postinstall scriptlet (using /bin/sh):
function mod_nss() {
if [ -f "$1" ] ; then
# Add nss-systemd to passwd and group
grep -E -q '^(passwd|group):.* systemd' "$1" ||
sed -i.bak -r -e '
s/^(passwd|group):(.*)/\1:\2 systemd/
' "$1" &>/dev/null || :
fi
}
FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)"
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
mod_nss "/etc/authselect/user-nsswitch.conf"
authselect apply-changes &> /dev/null || :
else
mod_nss "$FILE"
# also apply the same changes to user-nsswitch.conf to affect
# possible future authselect configuration
mod_nss "/etc/authselect/user-nsswitch.conf"
fi
...
Does systemd still touch the nsswitch.conf on its own? AFAIK I removed the scriptlets in Fedora 37... This can be left on authselect, so it shouldn't be necessary to run any scriptlet on systemd side.
See: https://fedoraproject.org/wiki/Changes/Make_Authselect_Mandatory
Ah, this is RHEL, the authselect change is not yet there. In that case, probably touching nsswitch.conf only on first install should be sufficient to avoid overriding user changes.
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 (systemd 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:6640