From patchwork Fri Jul 13 11:10:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [meta-system, 1/2] systemd.bbclass: introduce SYSTEMD_AUTO_ENABLE variable Date: Fri, 13 Jul 2012 11:10:45 -0000 From: =?utf-8?q?Andreas_M=C3=BCller_=3Cschnitzeltony=40googlemail=2Ecom=3E?= X-Patchwork-Id: 31957 Message-Id: <1342177846-26594-2-git-send-email-schnitzeltony@googlemail.com> To: openembedded-devel@lists.openembedded.org Currently all services introduced are enabled and started at installation. By setting SYSTEMD_AUTO_ENABLE = "disable" the default behaviour can be overridden. Signed-off-by: Andreas Müller --- meta-systemd/classes/systemd.bbclass | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass index 8af0d58..38b9ed5 100644 --- a/meta-systemd/classes/systemd.bbclass +++ b/meta-systemd/classes/systemd.bbclass @@ -1,5 +1,7 @@ DEPENDS_append = " systemd-systemctl-native" +SYSTEMD_AUTO_ENABLE ??= "enable" + systemd_postinst() { OPTS="" @@ -7,9 +9,9 @@ if [ -n "$D" ]; then OPTS="--root=$D" fi -systemctl $OPTS enable ${SYSTEMD_SERVICE} +systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE} -if [ -z "$D" ]; then +if [ -z "$D" -a ${SYSTEMD_AUTO_ENABLE} = "enable" ]; then systemctl start ${SYSTEMD_SERVICE} fi }