Skip to content

An instantiated User= does not effect subsequent specifiers #1476

@Earnestly

Description

@Earnestly

When using User=%i with a specifier, the result doesn't seem to propagate to other specifiers used within the unit such as %h.

For example [email protected]

...

[Service]
User=%i
Environment=XDG_CONFIG_HOME=%h/local/cfg
Environment=XDG_DATA_HOME=%h/local/data
Environment=XDG_CACHE_HOME=%h/local/var/cache
...

After this change inspecting (systemctl show) an instantiated unit such as user@1000 reports the following environments:

...
Environment=XDG_CONFIG_HOME=/root/local/cfg XDG_DATA_HOME=/root/local/data XDG_CACHE_HOME=/root/local/var/cache
...

I would have expected the expanded User= to also correctly expand %h according to that user's home directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions