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.