aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@googlemail.com>2012-08-28 06:25:48 +0000
committerEric Bénard <eric@eukrea.com>2012-09-02 15:03:00 +0200
commit59c995359502910da4dd60fb53130c84b23d96e8 (patch)
tree19d487c871652c7ce4f7808a056d991169447ba1 /meta-oe
parent577943f85154be553b8133b3f2a13f53892152c4 (diff)
downloadmeta-openembedded-59c995359502910da4dd60fb53130c84b23d96e8.tar.gz
systemd.bbclass: introduce SYSTEMD_AUTO_ENABLE variable
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: Eric Bénard <eric@eukrea.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/classes/systemd.bbclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index babe15e315..a2c8ddf0ec 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
}