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

Sentry image

Make it make sense

Only the context you need to fix your broken code with Sentry.

Start debugging →

Top comments (0)

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

Image of Datadog

Get the real story behind DevSecOps

Explore data from thousands of apps to uncover how container image size, deployment frequency, and runtime context affect real-world security. Discover seven key insights that can help you build and ship more secure software.

Read the Report

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay