coreos-home-server/service/prosody/systemd/prosody-component-register@.service
Alex Palaistras 38ded924a9 Update Prosody to version 0.12
This brings a number of changes and improvements, and moves from MariaDB
to SQLite for storage, which requires manual migration for pre-existing
deployments using `prosody-migrator`.
2022-03-22 20:23:07 +00:00

24 lines
1.0 KiB
Desktop File

[Unit]
Description=Prosody XMPP Component for %I
Wants=prosody.service
After=prosody.service
[Service]
Type=oneshot
RemainAfterExit=true
SyslogIdentifier=%N
Environment=PROSODY_COMPONENT_NAME=%i
EnvironmentFile=-%E/coreos-home-server/%i/%i.env
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/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
ExecStop=/bin/podman exec prosody prosodyctl shell host deactivate "$PROSODY_COMPONENT_NAME"
ExecStopPost=/bin/podman exec --user=root prosody rm -f /etc/prosody/conf.d/%i.cfg.lua
ExecStartPre=/bin/podman exec prosody prosodyctl shell config reload
[Install]
WantedBy=multi-user.target