Skip to content

Commit

Permalink
mxservicectl: Continue after systemctl start error
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
donald committed Jan 3, 2019
1 parent 7270e3b commit b37a798
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mxservicectl
Original file line number Diff line number Diff line change
Expand Up @@ -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" &
Expand All @@ -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" &
Expand Down

0 comments on commit b37a798

Please sign in to comment.