Closed xduugu closed 1 year ago
@ygalblum PTAL
@vrothberg WDYT?
I don't think systemd-specifiers can easily be supported. The Quadlet-related fields are interpreted by Quadlet and not by systemd, as such I don't see it as a bug.
Well quadlet thinks that this is a relative path and thus adds the systemd unit dir path in front which is a incorrect assumption. As reported it should be possible to check for the systemd specifier. If quadlet doesn't properly support systemd specifiers it will be much more difficult to create generic units that can be run everywhere.
Apologies, I skimmed the issue in a hurry and skipped the important part. I totally agree that Quadlet should properly process the identifiers, pass them on and let systemd interpret it.
Thanks for implementing this so fast! @ygalblum
Issue Description
When a systemd specifier like
%h
is used in the path forEnvironmentFile
, it is not recognized as an absolute path and the.container
file location (e.g./var/home/podman/.config/containers/systemd
) is prepended. For theVolume
key, it works fine, at least in 4.4.1, but maybe it is also broken now because of commit https://github.com/containers/podman/commit/5382997e01ef0326e2d34832724ff8114b0e5930.Steps to reproduce the issue
Steps to reproduce the issue
.container
file with contentsystemctl --user daemon-reload
$XDG_RUNTIME_DIR/systemd/generator/
Describe the results you received
The
EnvironmentFile
line is translated into thepodman container run
argument--env-file /var/home/podman/.config/containers/systemd/%h/env
.Describe the results you expected
The
EnvironmentFile
path should be adopted unmodified. The correct commandline argument is:--env-file %h/env
.There are several systemd specifiers for different paths. Either all paths starting with
%[a-zA-Z]
should be assumed to be absolute or it can be specifically checked for the path specifiers:%C
%d
%E
%h
%L
%S
%t
%T
%V
%Y
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting