pyinfra: enable-linger is necessary for systemd user units

This commit is contained in:
missytake 2023-12-01 16:21:43 +01:00
parent 05bb1d162c
commit 97d151dabd

View file

@ -79,6 +79,12 @@ def deploy_teams_bot(
unix_user=unix_user,
bot_email=bot_email,
)
server.shell(
name=f"enable {unix_user}'s systemd units to auto-start at boot",
commands=[f"loginctl enable-linger {unix_user}"],
)
systemd.daemon_reload(
name=f"{unix_user}: load teams-bot systemd service",
user_name=unix_user,