pyinfra: enable-linger is necessary for systemd user units

pull/13/head
missytake 2023-12-01 16:21:43 +01:00
parent 05bb1d162c
commit 97d151dabd
1 changed files with 6 additions and 0 deletions

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,