diff options
author | Andreas Müller <schnitzeltony@googlemail.com> | 2012-07-13 12:40:50 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-07-16 09:39:08 +0200 |
commit | 6e6bd9af71047e6f3b867d23bbbcca320ae2f1e8 (patch) | |
tree | 69ceb4f9a33ff7a0597bfdd18a1fb33f99040999 /meta-systemd | |
parent | c21e67f8e5ac13d35dd6e4312f19220453c06f0a (diff) | |
download | meta-openembedded-6e6bd9af71047e6f3b867d23bbbcca320ae2f1e8.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.
Diffstat (limited to 'meta-systemd')
-rw-r--r-- | 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 8af0d58cf..38b9ed5c0 100644 --- a/meta-systemd/classes/systemd.bbclass +++ b/meta-systemd/classes/systemd.bbclass | |||
@@ -1,5 +1,7 @@ | |||
1 | DEPENDS_append = " systemd-systemctl-native" | 1 | DEPENDS_append = " systemd-systemctl-native" |
2 | 2 | ||
3 | SYSTEMD_AUTO_ENABLE ??= "enable" | ||
4 | |||
3 | systemd_postinst() { | 5 | systemd_postinst() { |
4 | OPTS="" | 6 | OPTS="" |
5 | 7 | ||
@@ -7,9 +9,9 @@ if [ -n "$D" ]; then | |||
7 | OPTS="--root=$D" | 9 | OPTS="--root=$D" |
8 | fi | 10 | fi |
9 | 11 | ||
10 | systemctl $OPTS enable ${SYSTEMD_SERVICE} | 12 | systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE} |
11 | 13 | ||
12 | if [ -z "$D" ]; then | 14 | if [ -z "$D" -a ${SYSTEMD_AUTO_ENABLE} = "enable" ]; then |
13 | systemctl start ${SYSTEMD_SERVICE} | 15 | systemctl start ${SYSTEMD_SERVICE} |
14 | fi | 16 | fi |
15 | } | 17 | } |