summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2020-12-02 10:21:45 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-06 23:17:28 +0000
commit12a19ba56e4874777592506ee520fe5a5803c40e (patch)
tree3349f7ec67fd7329b007fbcdd4a79efe4ed4d363 /meta/classes
parent2ab32edca8ebf07be5c38954f8f860f5fa91c59d (diff)
downloadpoky-12a19ba56e4874777592506ee520fe5a5803c40e.tar.gz
systemd.bbclass: update command to check systemctl available
When use a core image with systemd as docker image, it fails to install/remove package which calls systemctl in post scripts. It fails to run systemctl in a container: bash-5.0# systemctl System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down So replace the criterion command 'type systemctl' with 'systemctl' in package post scripts to check whether systemctl available. (From OE-Core rev: a52e66762c0c51918b1ba3d4622759637b6e920a) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/systemd.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 9e8a82c9f1..9ec465c759 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -23,7 +23,7 @@ python __anonymous() {
23} 23}
24 24
25systemd_postinst() { 25systemd_postinst() {
26if type systemctl >/dev/null 2>/dev/null; then 26if systemctl >/dev/null 2>/dev/null; then
27 OPTS="" 27 OPTS=""
28 28
29 if [ -n "$D" ]; then 29 if [ -n "$D" ]; then
@@ -48,7 +48,7 @@ fi
48} 48}
49 49
50systemd_prerm() { 50systemd_prerm() {
51if type systemctl >/dev/null 2>/dev/null; then 51if systemctl >/dev/null 2>/dev/null; then
52 if [ -z "$D" ]; then 52 if [ -z "$D" ]; then
53 systemctl stop ${SYSTEMD_SERVICE_ESCAPED} 53 systemctl stop ${SYSTEMD_SERVICE_ESCAPED}
54 54