Score:0

Environment Variable set in systemd service file not set

pl flag

I have the problem than when I start my service a environment variable I have set in the service file is not set. The Service file is as follows

[Unit]
Description=<DESCRPITON>
After=podman.socket
Requires=podman.socket


[Service]
Environment=DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
TimeoutStartSec=0
ExecStart=/usr/bin/<BINARY_NAME>
Restart=always
Type=notify
NotifyAccess=all
User=<USER>


[Install]
WantedBy=multi-user.target

If I set the environment variable with systemctl --user set-environment DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock then it works. But not when the system is reboot as for some reason the information is lost.

I have to run the service under as the user and under the user, so it is run with systemctl enable --now serivce-name.service.

I have looked at How to set environment variable in systemd service? but could not find a solution from here. I was thinking about adding an configuraiton file, it just seems a little to much for a single Env variable.

This is running on Fedora and RedHat (8.8) if it is relevant.

danblack avatar
dz flag
look with `systemctl show mariadb.service`
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.