From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79876 invoked by alias); 8 Nov 2017 10:41:58 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 79852 invoked by uid 89); 8 Nov 2017 10:41:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Due, H*F:U*mark X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Nov 2017 10:41:51 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 99BFF31FFAAD; Wed, 8 Nov 2017 11:41:47 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 555AE413CE1E; Wed, 8 Nov 2017 11:41:47 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] config: Rely on systemd_requires for sysctl_apply default-yama-scope. Date: Wed, 08 Nov 2017 10:41:00 -0000 Message-Id: <1510137704-10105-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00037.txt.bz2 We try to run %sysctl_apply in %post. But that will only work if the systemd requires are there. Also since there is a circular dependency (systemd -> elfutils-libs -> default-yama-scope -> systemd) we need to double check that systemd-sysctl has already been installed before calling it. Signed-off-by: Mark Wielaard --- config/ChangeLog | 5 +++++ config/elfutils.spec.in | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/config/ChangeLog b/config/ChangeLog index ae40cc0..83263bd 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,8 @@ +2017-11-08 Mark Wielaard + + * elfutils.spec.in: Add systemd_requires. + Check systemd-sysctl exists. + 2017-11-02 Mark Wielaard * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir) diff --git a/config/elfutils.spec.in b/config/elfutils.spec.in index 1d0a4f8..21a18b2 100644 --- a/config/elfutils.spec.in +++ b/config/elfutils.spec.in @@ -107,6 +107,9 @@ Group: Development/Tools License: GPLv2+ or LGPLv3+ Provides: default-yama-scope BuildArch: noarch +# For the sysctl_apply macro +%{?systemd_requires} +BuildRequires: systemd >= 215 %description default-yama-scope Yama sysctl setting to enable default attach scope settings @@ -157,7 +160,11 @@ rm -rf ${RPM_BUILD_ROOT} %postun libelf -p /sbin/ldconfig %post default-yama-scope +# Due to circular dependencies might not be installed yet, so double check. +# (systemd -> elfutils-libs -> default-yama-scope -> systemd) +if [ -x /usr/lib/systemd/systemd-sysctl ] ; then %sysctl_apply 10-default-yama-scope.conf +fi %files %defattr(-,root,root) -- 1.8.3.1