Closed latenightdef closed 1 year ago
@latenightdef thanks for reporting this issue.
I think the issue here is a race condition between Quadlet and the mounting of the partition in which the actual file resides. Such a race will cause the file to not be available for Quadlet to access when it is executed at boot. It also explains why this issue does not happen once boot is completed and why the same works for rootless.
Can you please check the Journal logs to see if Quadlet prints an error of the sort of no such file or directory
?
I tried running journalctl -b -0 | grep "No such file or directory"
and it shows
Nov 12 17:27:49 efosa syncthing[1866]: crontab: can't open 'abc': No such file or directory
which belongs to another rootless container and not the one I'm trying to autostart
I think the issue here is a race condition between Quadlet and the mounting of the partition in which the actual file resides. Such a race will cause the file to not be available for Quadlet to access when it is executed at boot. It also explains why this issue does not happen once boot is completed and why the same works for rootless.
Probably, since after copying the actual homeassistant.container
file to /etc/containers/systemd
, the homeassistant container autostarts correctly.
I'm not sure this issue can be resolved.
Quadlet and systemd-fstab-generator are both systemd generators. These generators are executed in parallel and as a result cannot depend on one another. In your case, Quadlet needs to depend on systemd-fstab-generator to run for systemd to mount the volume before Quadlet can start. However, there is no way to guaranty it.
@alexlarsson @rhatdan WDYT?
Seems reasonable. I guess the quadlet file needs to be on the same file system as /etc/containers/systemd or /usr/containers/systemd, other file systems are not guaranteed to be mounted.
Issue Description
I have a container file in another partition symlinked to /etc/containers/systemd. The command
/usr/libexec/podman/quadlet -dryrun
shows the output of container file just fine, which shows:When the host is restarted, the generated systemd service does not show up and the container doesn't autostart. I have to manually run
systemctl daemon-reload
to see the generated service appear insystemctl list-units
and start the service manually to use the container.But when I run the container in rootless mode (symlinking the same container file to ~/.config/containers/systemd), it autostarts normally.
Steps to reproduce the issue
Steps to reproduce the issue
systemctl daemon-reload
and start the generated serviceDescribe the results you received
The container does not autostart
Describe the results you expected
The container autostarts just like when running in rootless.
podman info output