Re:Make systemd better for Podman with Quadlet
by INTPenis on Tuesday February 21, 2023 @04:21AM
(#34878755)
Yeah but they have invented the declarative file format, but they put it in /etc, why not put it in $HOME/.config/systemd instead? That would make it more on-par with docker compose.
I'm hoping this is in the future of quadlet. Being able to run the files from CWD, using systemd units in $HOME, and not requiring root.
Re:Make systemd better for Podman with Quadlet
by alexlarsson on Tuesday February 21, 2023 @04:46AM
(#34878986)
For rootless use, put the files in ~/.config/containers/systemd/
Re:Make systemd better for Podman with Quadlet
by INTPenis on Tuesday February 21, 2023 @05:21AM
(#34879213)
Thanks I just realized that.
So really for a developer it would potentially be this simple;
cp my-app.container $HOME/.config/containers/systemd && systemctl --user daemon-reload
Just to compare with docker-compose again.
Re:Make systemd better for Podman with Quadlet
by bongobingo1 on Tuesday February 21, 2023 @05:28AM
(#34879285)
You should be able to use `systemctl --user link` which is a bit nicer than copying.
link PATH...
Link a unit file that is not in the unit file search path into the unit
file search path. This command expects an absolute path to a unit file.
The effect of this may be undone with disable. The effect of this command
is that a unit file is made available for commands such as start, even
though it is not installed directly in the unit search path. The file
system where the linked unit files are located must be accessible when
systemd is started (e.g. anything underneath /home/ or /var/ is not
allowed, unless those directories are located on the root file system).
Re:Make systemd better for Podman with Quadlet
by config_yml on Tuesday February 21, 2023 @07:51AM
(#34880541)
The cool thing is you can also create .kube file which points to a kubernetes pod definition yaml. This also generates a service definition which takes care of running a full pod with all your containers.
Re:Make systemd better for Podman with Quadlet
by config_yml on Tuesday February 21, 2023 @01:27PM
(#34884790)
Can you run your stuff on port 80/443 like this?
Re:Make systemd better for Podman with Quadlet
by bonzini on Tuesday February 21, 2023 @05:06AM
(#34879115)
Alex, since you're here does quadlet support override files like systemd's /etc/systemd/system/foo.service.d directories? I couldn't find it in the documentation.
Re:Make systemd better for Podman with Quadlet
by alexlarsson on Tuesday February 21, 2023 @05:25AM
(#34879254)
The generator doesn't do that atm no. Seems like it would be useful though.
On the other hand, I belive systemd would load override files for the generated .service file, although those can just override details on the systemd level, not the generated podman command.
Re:Make systemd better for Podman with Quadlet
by bonzini on Tuesday February 21, 2023 @09:22AM
(#34881467)
Yeah, my usecase was to override Network or Expose directives.
Re:Make systemd better for Podman with Quadlet
by rhatdan on Tuesday February 21, 2023 @07:33AM
(#34880372)
It works in the home directory. Just place the quadlet file in $HOME/.config/containers/systemd
$ systemctl --user daemon-reload
$ systemctl --user start QUADLETNAME.service
If you want this to work at boot, you need to do loginctl enable-linger $USERNAME
Generators are the same mechanism by which systemd reads /etc/fstab; just like /etc/fstab entries are treated by systemd as "normal" mount units, systemd will treat .container files just like any other system service.