Score:0

Using a non absulte path for Exec on a systemd user service

in flag

I've created a unit to run at user login, but when trying to start it, I get the following error:

/home/myUser/.config/systemd/user/myUnit.service:5: Neither a valid executable name nor an absolute path: $HOME/.local/bin/myProgram

This is ~/.config/systemd/user/myUnit.service:

[Unit]
Description=Some description...

[Service]
ExecStart=$HOME/.local/bin/myProgram
Type=forking

[Install]
WantedBy=default.target

Systemd wants an absolute path, obviously; but is there a way to not hardcode the home directory per every user, and also don't take out the binary outside the user's home?

I believe there should be one, since we are allowed to place user's units inside the user's own home...

user535733 avatar
cn flag
Seems like a duplicate of https://serverfault.com/questions/794922/ . Try those answers.
in flag
Thank you, using `%h` was the solution! =)
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.