summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes-recipe/systemd.bbclass14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes-recipe/systemd.bbclass b/meta/classes-recipe/systemd.bbclass
index 0bce015509..4c9f51d33d 100644
--- a/meta/classes-recipe/systemd.bbclass
+++ b/meta/classes-recipe/systemd.bbclass
@@ -40,14 +40,24 @@ if systemctl >/dev/null 2>/dev/null; then
40 for service in ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}; do 40 for service in ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}; do
41 systemctl ${OPTS} enable "$service" 41 systemctl ${OPTS} enable "$service"
42 done 42 done
43
44 for service in ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}; do
45 systemctl --global ${OPTS} enable "$service"
46 done
43 fi 47 fi
44 48
45 if [ -z "$D" ]; then 49 if [ -z "$D" ]; then
50 # Reload only system service manager
51 # --global for daemon-reload is not supported: https://github.com/systemd/systemd/issues/19284
46 systemctl daemon-reload 52 systemctl daemon-reload
47 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ] && \ 53 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ] && \
48 systemctl preset ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 54 systemctl preset ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}
49 55
56 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}" ] && \
57 systemctl --global preset ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}
58
50 if [ "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then 59 if [ "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
60 # --global flag for restart is not supported by systemd (see above)
51 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ] && \ 61 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}" ] && \
52 systemctl --no-block restart ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 62 systemctl --no-block restart ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}
53 fi 63 fi
@@ -62,6 +72,10 @@ if systemctl >/dev/null 2>/dev/null; then
62 systemctl stop ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 72 systemctl stop ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}
63 systemctl disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)} 73 systemctl disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", False, d)}
64 fi 74 fi
75
76 # same as above, --global flag is not supported for stop so do disable only
77 [ -n "${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}" ] && \
78 systemctl --global disable ${@systemd_filter_services("${SYSTEMD_SERVICE_ESCAPED}", True, d)}
65 fi 79 fi
66fi 80fi
67} 81}