logged.

<< back to post overview

Podman Quadlets and systemd "start request repeated too quickly."

tl;dr: Use absolute paths for mounted folders in Quadlets!

There are a couple of reasons why I choose Podman to run containers on my machines. One of them is the possiblity to run rootless containers, which eliminate the need to fiddle around with root accounts or giving your user account unnecessary permission to run them (as docker needs for example).

One caveat which comes with using Podman though is due to its daemon-less approach: Handling the container lifecycle, e.g. starting a container on boot, becomes something separate to handle.

Luckily there are Quadlets, which are the offical way of handling podman containers via systemd. For starting containers automatically on boot, you "just" have to write a systemd service file, save it to a dedicated location and start/enable that new systemd service.

In practice this fails for me every now and then with the following error being thrown after trying to start the systemd service:

coolsoftware.service: Start request repeated too quickly.
coolsoftware.service: Failed with result 'exit-code'.

Looking at this via either systemd --user status coolsoftware.service and journalctl both did not give me more insight in why this was failing. Researching for that error message yielded in a lot of different issues and reasons.

It was a bit by accident to find the reason why this was happening. While researching I stumbled across a repository containing Podman Quadlet files of GitHub user dweida who also happens to describe Quadlets in the README.
In it there is the following sentence:

"IMPORTANT NOTE: unlike docker-compose or podman-compose quadlets do not create the folders we specify under volumes, so be sure to create them manually with "mkdir -p /path/to/folder/for/volume""

Here it hit me: The containers failing all have folders mounted to them and they all exist, but what I missed was that I was using the relative path of the folder which I was using in my compose files. After moving the systemd service files to their dedicated location (~/.config/containers/systemd in my case) that path was not valid anymore.

So in the end all I needed to do was using an absolute path pointing to the desired folders I wanted to be mounted. That's it!