Patchwork [for-denzil,meta-oe,6/7] systemd.bbclass: introduce SYSTEMD_AUTO_ENABLE variable

login
register
mail settings
Submitter Koen Kooi
Date Aug. 28, 2012, 6:25 a.m.
Message ID <1346135149-11256-6-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/35423/
State Accepted
Headers show

Comments

Koen Kooi - Aug. 28, 2012, 6:25 a.m.
From: Andreas Müller <schnitzeltony@googlemail.com>

Currently all services introduced are enabled and started at installation. By
setting SYSTEMD_AUTO_ENABLE = "disable" the default behaviour can be
overridden.
---
 meta-oe/classes/systemd.bbclass |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index babe15e..a2c8ddf 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/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
 }