From 6f7b2d99ac0c82221629769b29b9386bd43e58f0 Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sun, 1 May 2022 14:54:16 +0100 Subject: [PATCH] Improve reliability for prosody-component-register This would sometimes fail to start cleanly after abrupt shutdowns, and will now try to converge to a good state before starting. --- service/prosody/systemd/prosody-component-register@.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/prosody/systemd/prosody-component-register@.service b/service/prosody/systemd/prosody-component-register@.service index 910535e..fff8099 100644 --- a/service/prosody/systemd/prosody-component-register@.service +++ b/service/prosody/systemd/prosody-component-register@.service @@ -9,10 +9,10 @@ RemainAfterExit=true SyslogIdentifier=%N Environment=PROSODY_COMPONENT_NAME=%i EnvironmentFile=-%E/coreos-home-server/%i/%i.env -ExecCondition=/bin/sh -c "podman exec prosody prosodyctl shell host list | grep --quiet $PROSODY_COMPONENT_NAME; test $? -ne 0" ExecStartPre=/bin/install --mode 0700 --directory /tmp/%N ExecStartPre=/bin/sh -c "envsubst < %E/coreos-home-server/prosody/service/component.cfg.lua.template > /tmp/%N/component.cfg.lua" ExecStartPre=/bin/podman cp --archive=false /tmp/%N/component.cfg.lua prosody:/etc/prosody/conf.d/%i.cfg.lua +ExecStartPre=/bin/sh -c 'podman exec prosody prosodyctl shell host deactivate "$PROSODY_COMPONENT_NAME" || true' ExecStartPre=/bin/podman exec prosody prosodyctl shell config reload ExecStart=/bin/podman exec prosody prosodyctl shell host activate "$PROSODY_COMPONENT_NAME" ExecStartPost=/bin/rm -Rf /tmp/%N