summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/systemd.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/systemd.bbclass')
-rw-r--r--meta/classes-recipe/systemd.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes-recipe/systemd.bbclass b/meta/classes-recipe/systemd.bbclass
index 12c59647be..3d8ca24a68 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -29,7 +29,7 @@ python __anonymous() {
29} 29}
30 30
31systemd_postinst() { 31systemd_postinst() {
32if systemctl >/dev/null 2>/dev/null; then 32if type systemctl >/dev/null 2>/dev/null; then
33 OPTS="" 33 OPTS=""
34 34
35 if [ -n "$D" ]; then 35 if [ -n "$D" ]; then
@@ -46,7 +46,7 @@ if systemctl >/dev/null 2>/dev/null; then
46 done 46 done
47 fi 47 fi
48 48
49 if [ -z "$D" ]; then 49 if [ -z "$D" ] && systemctl >/dev/null 2>/dev/null; then
50 # Reload only system service manager 50 # Reload only system service manager
51 # --global for daemon-reload is not supported: https://github.com/systemd/systemd/issues/19284 51 # --global for daemon-reload is not supported: https://github.com/systemd/systemd/issues/19284
52 systemctl daemon-reload 52 systemctl daemon-reload
@@ -66,8 +66,8 @@ fi
66} 66}
67 67
68systemd_prerm() { 68systemd_prerm() {
69if systemctl >/dev/null 2>/dev/null; then 69if type systemctl >/dev/null 2>/dev/null; then
70 if [ -z "$D" ]; then 70 if [ -z "$D" ] && systemctl >/dev/null 2>/dev/null; then
71 if [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ]; then 71 if [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ]; then
72 systemctl stop ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 72 systemctl stop ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}
73 systemctl disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 73 systemctl disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}