DEV Community

Piotr
Piotr

Posted on • Originally published at garden.piotrk.it on

Podman on debian How to fix podman no services after restart

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/ 
Enter fullscreen mode Exit fullscreen mode

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 
Enter fullscreen mode Exit fullscreen mode

Reload units:

systemctl --user daemon-reload; journalctl -f 
Enter fullscreen mode Exit fullscreen mode

Enable service and timer:

systemctl --user enable podman-restart.service 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.