Open Fl0GUI opened 5 months ago
Pretty sure the issue happens on
and the implementation of
Thanks for reporting this. While I agree this is an issue, I wonder what is your use case here. Are you planning on linking different networks to different .container
files? If yes, then, currently, linking between templated Qualdet files does not work. You may see #17744 for details.
Thank you for the links. It's an interesting discussion but I must admit I'm not familiar enough with systems units to contribute to it.
As for my use case; I'm setting up my home servers with a couple of domains. Each domain corresponds to a podman network that has the relevant services running under it. Services that are directly related are put in a pod (eg web server + database.) Services could join multiple networks if it makes sense. I have traefik connected to all the networks and doing all the routing.
Each network is the same except for the name, so a template would be nice to use instead of copy pasting the network file.
if templates aren't that supported maybe it should be documented as such. I was referencing the man page for quadlet but I can't check it rn.
With that being said, I'm fine with this issue being closed.
A friendly reminder that this issue had no activity for 30 days.
@ygalblum Did the changes to allow named services help here?
@rhatdan unfortunately no. The issue here is with templates and overriding the name is not supposed to resolve templates
Issue Description
when trying to create a templated network using quadlet, the resulting unit file doesn't have the
@
in the correct place to be a templated unit. For example take the filefoo@.network
:quadlet will generate
foo@-network.service
just like the documentation saysWhere name is
foo@
in this case. But looking at the documentation ofsystemd.unit
The prefix being
.service
. So this unit file does not work, cannot be instanciated, and I only got it to run withsystemctl start foo@-network.service
. The result of which is that-network
is used as the network name, which podman sees as a command line option:Steps to reproduce the issue
Steps to reproduce the issue
foo@.network
with the content as shown in the description. Place this in~/.config/containers/systemd
.systemctl --user daemon-reload
.systemctl --user list-unit-files
that the name isfoo@-network.service
systemctl --user start foo@bar-network.service
or just trysystemctl --user start foo@-network.service
Describe the results you received
Either
Unit foo@bar-network.service could not be found.
from systemctl, orError: unknown shorthand flag: 'n' in -network
from podman.Describe the results you expected
I would expect the resulting unit file to have a valid format, eg.
foo-network@.service
. The@
should be right before.service
. With this unit file as a result the network should be possible to create.podman info output
$ systemctl --version systemd 255 (255.6-1.fc40) +PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP -GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN -IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified $ cat /etc/fedora-release Fedora release 40 (Forty)