commit:     e92f7252b53bce0359a7dedbf02d5d6cb3dc1c44
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 22 20:48:52 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sat Jul 22 20:48:52 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e92f7252

sys-apps/systemd: create sysctl.d symlink only when /etc/sysctl.conf exists

Closes: https://bugs.gentoo.org/885287
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 sys-apps/systemd/systemd-254_rc2.ebuild | 8 +++++---
 sys-apps/systemd/systemd-9999.ebuild    | 8 +++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/sys-apps/systemd/systemd-254_rc2.ebuild 
b/sys-apps/systemd/systemd-254_rc2.ebuild
index 79a152ddc472..0bd6dcb2fb85 100644
--- a/sys-apps/systemd/systemd-254_rc2.ebuild
+++ b/sys-apps/systemd/systemd-254_rc2.ebuild
@@ -399,9 +399,6 @@ multilib_src_install_all() {
        keepdir /var/lib/systemd
        keepdir /var/log/journal
 
-       # Symlink /etc/sysctl.conf for easy migration.
-       dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
-
        if use pam; then
                newpamd "${FILESDIR}"/systemd-user.pam systemd-user
        fi
@@ -465,6 +462,11 @@ migrate_locale() {
 }
 
 pkg_preinst() {
+       if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
+               # Symlink /etc/sysctl.conf for easy migration.
+               dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
+       fi
+
        if ! use split-usr; then
                local dir
                for dir in bin sbin lib usr/sbin; do

diff --git a/sys-apps/systemd/systemd-9999.ebuild 
b/sys-apps/systemd/systemd-9999.ebuild
index 1b78026dc881..2995dae33660 100644
--- a/sys-apps/systemd/systemd-9999.ebuild
+++ b/sys-apps/systemd/systemd-9999.ebuild
@@ -399,9 +399,6 @@ multilib_src_install_all() {
        keepdir /var/lib/systemd
        keepdir /var/log/journal
 
-       # Symlink /etc/sysctl.conf for easy migration.
-       dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
-
        if use pam; then
                newpamd "${FILESDIR}"/systemd-user.pam systemd-user
        fi
@@ -465,6 +462,11 @@ migrate_locale() {
 }
 
 pkg_preinst() {
+       if [[ -e ${EROOT}/etc/sysctl.conf ]]; then
+               # Symlink /etc/sysctl.conf for easy migration.
+               dosym ../../../etc/sysctl.conf /usr/lib/sysctl.d/99-sysctl.conf
+       fi
+
        if ! use split-usr; then
                local dir
                for dir in bin sbin lib usr/sbin; do

Reply via email to