Rootless podman works great with systemd to manage services ran as a user.
However it would be nice to add some docs for that somewhere, or tweak generate systemd for the rootless use case.
The 2 difficult points I ran into was:
[email protected] so the user dbus session is initialized and the /run user folder existsHere is a working unit:
[Unit]
Description=nginx
[email protected]
[email protected]
[Service]
Type=simple
KillMode=none
ExecStartPre=-/usr/bin/podman rm -f nginx
ExecStartPre=/usr/bin/podman pull nginx
ExecStart=/usr/bin/podman run --name=nginx -p 8080:80 nginx
ExecStop=/usr/bin/podman stop nginx
Restart=always
User=nginx
Group=nginx
[Install]
WantedBy=multi-user.target
PRs and Blogs welcomed. :^)
Where do you think I could contribute such a doc ?
rootless_tutorial.md ?
I'd drop it in rootless_tutorial at least to start. I'd make a new section for it in that md file.
I think both of these could be pretty easily dropped into generate systemd as defaults based on a rootless.IsRootless() check