From b37a798b894b4a12b79c927dc0c76b935fbcf9be Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 3 Jan 2019 14:30:46 +0100 Subject: [PATCH] mxservicectl: Continue after `systemctl start` error If `systemctl start SERVICE` fails for whatever reasons, mxservicectl, which is running with the -e option, immediately exits with a non-zero exit status and doesn't attempt to start later mxstartup services. The exist status will also be the final exit status of mxstartupctl. If mxstartupctl has been called from mxstartup-classic.service, the service startup is regarded as a failure and systemd kills all processes in the group, which terminates all previously started mxstartup services. Ignore exit status from `systemctl start SERVICE'. --- mxservicectl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mxservicectl b/mxservicectl index 49dacd9..7b7fee3 100755 --- a/mxservicectl +++ b/mxservicectl @@ -21,7 +21,7 @@ function mxsrv_start_one() { case "${MX_SRV_SCRIPT}" in *.service) - systemctl start "${MX_SRV_SCRIPT}" + systemctl start "${MX_SRV_SCRIPT}" || true ;; *) su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} start" & @@ -43,7 +43,7 @@ function mxsrv_stop_one() { case "${MX_SRV_SCRIPT}" in *.service) - systemctl stop "${MX_SRV_SCRIPT}" + systemctl stop "${MX_SRV_SCRIPT}" || true ;; *) su - ${MX_SRV_USER} -c "${MX_SRV_SCRIPT} stop" &