I was read the following tutorial. And its works well.
How do i use that to get a container to autostart? Rootless podman.
When does podman make the service file in /run/user/1000/systemd/generator/
After having a unit file myApp.container dropped off in /var/home/core/.config/containers/systemd/
In that, can i just put a "storage: links: - path://target: " into my butane and call it a day
or would i need to have some service that runs at reboot/shutdown/powerON to symlink the files into place and reboot once post install?
First of all, to run systemd user units on boot you need to enable lingering (create a file /var/lib/systemd/linger/$USER).
For Quadlets, youâll additionally need to make sure that the network-online.target is enabled and wanted by multi-user.target, because your Quadlet units will gain a dependency on podman-user-wait-network-online.service, which simply waits in a loop for network-online.target to become active.
According to man podman-systemd.unit, the generator will then read the Quadlet files âduring boot (and when systemctl daemon-reload is run)â. You wonât have to create any extra links etc. after placing your Quadlets in ~/.config/containers/systemd/.
I published an extensive configuration example on GitHub for a server running rootless Quadlets. It uses the extended Pyromaniac syntax instead of pure Butane but should be relatively easy to understand anyways.
Past that:
Yes, lingering. I seem to have that working.
Im slightly interested in that network-online.target. I read a few github discussions on that.
I ended up taking each Container Unit and setting:
[Unit]
Description=phpIPAM MariaDB
After=podman-user-wait-network-online.service
Wants=podman-user-wait-network-online.service
I did NOT set the last:
[Install]
WantedBy=multi-user.target
I assumed that was fine.
podman-user-wait-network-online.service seems to work. But network-online.target may have also worked. Podman will change that out anyway being a rootless container unit/quadlet.
where i get is everything is ready to go, just doent start unless i âsystemctl --user start containerâ
This talks about the podman-user-wait-network-online.service:
I have lost where i located /run/user/1000/systemd/generator/dashy.service from. but thats the location that systemd appears to read for rootless units. setting a symlink to that location makes it work on reboot.
I think you misunderstood. The generator automatically adds the dependencies on podman-user-wait-network-online.service. What you need to do, is adding the drop-in to the system unit called network-online.target, as is done in my YAML example.
You also donât need to worry about /run/user/1000/systemd/generator/. You specify the units by placing .container, .image, etc. files in /home/core/.config/containers/systemd/. If you want them to be started at boot, you need to have âWantedBy=default.targetâ in the unitâs â[Install]â section.
TL;DR
Add file /var/lib/systemd/linger/core
Add the WantedBy=multi-user.target drop-in to network-online.target
Create units in ~/.config/containers/systemd/ with WantedBy=default.target