From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Greylist: delayed 356 seconds by postgrey-1.34 at layers.openembedded.org; Tue, 18 Jun 2019 10:14:20 UTC Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by mail.openembedded.org (Postfix) with ESMTP id A475B7E81D for ; Tue, 18 Jun 2019 10:14:20 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45SkLJ4PTNz1rKJ3; Tue, 18 Jun 2019 12:08:24 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45SkLJ4Bd2z1qqkT; Tue, 18 Jun 2019 12:08:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id qS8CtaHwW3G2; Tue, 18 Jun 2019 12:08:23 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 18 Jun 2019 12:08:23 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 5750A454045E; Tue, 18 Jun 2019 12:08:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DOsmOaaIgR7R; Tue, 18 Jun 2019 12:08:19 +0200 (CEST) Received: from localhost.localdomain (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id AA79B45402A6; Tue, 18 Jun 2019 12:08:19 +0200 (CEST) From: Stefano Babic To: openembedded-core@lists.openembedded.org Date: Tue, 18 Jun 2019 12:06:17 +0200 Message-Id: <20190618100617.25265-1-sbabic@denx.de> X-Mailer: git-send-email 2.17.1 Subject: [PATCH] systat: systemd never enables the service X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 10:14:20 -0000 Even if SYSTEMD_AUTO_ENABLE is set to "enable", the service is never activated by systemd. The cause is the postinst function in the recipe: pkg_postinst_${PN} () { if [ -n "$D" ]; then exit 0 fi if [ -e /etc/init.d/populate-volatile.sh ]; then /etc/init.d/populate-volatile.sh update fi } This generates with activated systemd the following postinst script: set -e if [ -n "$D" ]; then exit 0 fi if [ -e /etc/init.d/populate-volatile.sh ]; then /etc/init.d/populate-volatile.sh update fi OPTS="" if [ -n "$D" ]; then OPTS="--root=$D" fi if type systemctl >/dev/null 2>/dev/null; then if [ -z "$D" ]; then systemctl daemon-reload fi systemctl $OPTS enable sysstat.service if [ -z "$D" -a "enable" = "enable" ]; then systemctl --no-block restart sysstat.service fi fi Due to the exit statement, systemctl is never called and the service is never enabled in rootfs. Invert the logic for the check to let run the rest of postinst script. Signed-off-by: Stefano Babic --- meta/recipes-extended/sysstat/sysstat.inc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc index 0bc7e14d36..850a6d1465 100644 --- a/meta/recipes-extended/sysstat/sysstat.inc +++ b/meta/recipes-extended/sysstat/sysstat.inc @@ -51,12 +51,11 @@ do_install() { } pkg_postinst_${PN} () { - if [ -n "$D" ]; then - exit 0 - fi - if [ -e /etc/init.d/populate-volatile.sh ]; then - /etc/init.d/populate-volatile.sh update - fi + if [ ! -n "$D" ]; then + if [ -e /etc/init.d/populate-volatile.sh ]; then + /etc/init.d/populate-volatile.sh update + fi + fi } -- 2.17.1