From 7270e3bb33985e65ad799150b952cdfadefcaf03 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 3 Jan 2019 13:59:58 +0100 Subject: [PATCH 1/3] Remove mxstartup-mxvip service This is not needed as a service, because mxstartupctl from mxstartup-classic.service calls `mxvipctl start` by itself. Remove this service. --- Makefile | 1 - mxstartup-classic.service | 4 ++-- mxstartup-mxvip.service | 15 --------------- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 mxstartup-mxvip.service diff --git a/Makefile b/Makefile index 16dad41..5ed21a1 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ all: install: mkdir -p -m 0755 ${DESTDIR}${SYSTEMDSYSTEMDIR} - install -m 0644 mxstartup-mxvip.service ${DESTDIR}${SYSTEMDSYSTEMDIR} install -m 0644 mxstartup-classic.service ${DESTDIR}${SYSTEMDSYSTEMDIR} mkdir -p -m 0755 ${DESTDIR}${SBINDIR} install -m 0755 mxstartup2mxconfig ${DESTDIR}${SBINDIR} diff --git a/mxstartup-classic.service b/mxstartup-classic.service index 827854d..65d67f6 100644 --- a/mxstartup-classic.service +++ b/mxstartup-classic.service @@ -1,7 +1,7 @@ [Unit] Description=Mariux mxstartup classic -After=mxstartup-mxvip.service mxmount.service nis.service -Requires=mxstartup-mxvip.service mxmount.service +After=mxmount.service nis.service +Requires=mxmount.service [Service] Type=oneshot diff --git a/mxstartup-mxvip.service b/mxstartup-mxvip.service deleted file mode 100644 index 0ccd23e..0000000 --- a/mxstartup-mxvip.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Mariux Virtual IP and Forwarding -ConditionPathExists=/etc/mxstartups -Requires=network.target mxmount.service -After=network.target mxmount.service - -[Service] -Type=oneshot -ExecStart=/usr/sbin/mxvipctl start -ExecStop=/usr/sbin/mxvipctl stop -RemainAfterExit=yes -StandardOutput=syslog - -[Install] -WantedBy=multi-user.target From b37a798b894b4a12b79c927dc0c76b935fbcf9be Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 3 Jan 2019 14:30:46 +0100 Subject: [PATCH 2/3] 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" & From 7dd182d37dfd2f7330729916a265c9503c0583b2 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 3 Jan 2019 20:27:31 +0100 Subject: [PATCH 3/3] Rename mxstartup-classic.service to mxstartup.service The -classic postfix does no longer make any sense, because we removed the other mxstartup related units. --- Makefile | 2 +- mxstartup-classic.service => mxstartup.service | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename mxstartup-classic.service => mxstartup.service (100%) diff --git a/Makefile b/Makefile index 5ed21a1..9819033 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ all: install: mkdir -p -m 0755 ${DESTDIR}${SYSTEMDSYSTEMDIR} - install -m 0644 mxstartup-classic.service ${DESTDIR}${SYSTEMDSYSTEMDIR} + install -m 0644 mxstartup.service ${DESTDIR}${SYSTEMDSYSTEMDIR} mkdir -p -m 0755 ${DESTDIR}${SBINDIR} install -m 0755 mxstartup2mxconfig ${DESTDIR}${SBINDIR} install -m 0755 mxvipctl ${DESTDIR}${SBINDIR} diff --git a/mxstartup-classic.service b/mxstartup.service similarity index 100% rename from mxstartup-classic.service rename to mxstartup.service