Skip to content

Commit

Permalink
sys-libs/glibc: replace systemd reexec with a warning
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Closes: #22960
Signed-off-by: Sam James <sam@gentoo.org>
  • Loading branch information
floppym authored and thesamesam committed Dec 1, 2021
1 parent 2ecb1ef commit 30fe8b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
21 changes: 16 additions & 5 deletions sys-libs/glibc/glibc-2.34-r2.ebuild
Expand Up @@ -730,6 +730,20 @@ sanity_prechecks() {
fi
}

upgrade_warning() {
if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
local oldv newv=$(ver_cut 1-2 ${PV})
for oldv in ${REPLACING_VERSIONS}; do
if ver_test ${oldv} -lt ${newv}; then
ewarn "After upgrading glibc, please restart all running processes."
ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
ewarn "Alternatively, reboot your system."
break
fi
done
fi
}

#
# the phases
#
Expand All @@ -740,6 +754,7 @@ pkg_pretend() {
# All the checks...
einfo "Checking general environment sanity."
sanity_prechecks
upgrade_warning
}

pkg_setup() {
Expand Down Expand Up @@ -1547,11 +1562,7 @@ pkg_postinst() {
use compile-locales || run_locale_gen "${EROOT}/"
fi

if systemd_is_booted && [[ -z ${ROOT} ]] ; then
# We need to restart systemd when upgrading from < 2.34
# bug #823756
systemctl daemon-reexec
fi
upgrade_warning

# Check for sanity of /etc/nsswitch.conf, take 2
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
Expand Down
21 changes: 16 additions & 5 deletions sys-libs/glibc/glibc-9999.ebuild
Expand Up @@ -723,6 +723,20 @@ sanity_prechecks() {
fi
}

upgrade_warning() {
if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then
local oldv newv=$(ver_cut 1-2 ${PV})
for oldv in ${REPLACING_VERSIONS}; do
if ver_test ${oldv} -lt ${newv}; then
ewarn "After upgrading glibc, please restart all running processes."
ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)."
ewarn "Alternatively, reboot your system."
break
fi
done
fi
}

#
# the phases
#
Expand All @@ -733,6 +747,7 @@ pkg_pretend() {
# All the checks...
einfo "Checking general environment sanity."
sanity_prechecks
upgrade_warning
}

pkg_setup() {
Expand Down Expand Up @@ -1540,11 +1555,7 @@ pkg_postinst() {
use compile-locales || run_locale_gen "${EROOT}/"
fi

if systemd_is_booted && [[ -z ${ROOT} ]] ; then
# We need to restart systemd when upgrading from < 2.34
# bug #823756
systemctl daemon-reexec
fi
upgrade_warning

# Check for sanity of /etc/nsswitch.conf, take 2
if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then
Expand Down

0 comments on commit 30fe8b8

Please sign in to comment.