I noticed that with static build of podman, services didn’t start after I restarted my server, even though they had Restart=Always policy.

This is an issue that can popup when installing podman from a static build installation on debian.

Turns out that this issue is due to missing podman-restart.service that starts all the services after boot.

This file was originally from github repo, but with static podman build it is not present.

Create directory for

mkdir -p ~/.config/systemd/user/

Create file podman-restart.service:

[Unit]
Description=Podman Start All Containers With Restart Policy Set To Always
Documentation=man:podman-start(1)
StartLimitIntervalSec=0
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
RemainAfterExit=true
Environment=LOGGING="--log-level=info"
ExecStart=/usr/local/bin/podman $LOGGING start --all --filter restart-policy=always
ExecStop=/usr/local/bin/podman $LOGGING stop --all --filter restart-policy=always

[Install]
WantedBy=default.target

Reload units:

systemctl --user daemon-reload; journalctl -f

Enable service and timer:

systemctl --user enable podman-restart.service