Skip to content

Missing ~/.config/systemd/user/ on session start #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
k-husmann opened this issue Apr 23, 2020 · 2 comments
Closed

Missing ~/.config/systemd/user/ on session start #9

k-husmann opened this issue Apr 23, 2020 · 2 comments

Comments

@k-husmann
Copy link

Seems like the ~/.config/systemd/user/ directory needs to exist prior session start, otherwise systemd behaves weird:

  • I logged in, created that directory and a unit file therein.
  • systemctl --user list-unit-files listed the newly created unit file just fine,
  • but systemctl --user start my... gave an error like that:
$> systemctl --user start mytestunit.service
Failed to start mytestunit.service: Unit mytestunit.service not found.`

It took me a while to debug that. In the end, I just run sudo reboot and from there on everything worked fine - just as explained in your repo. Also with newly created unit files. That's why I expect that this directory needs to exist prior user session start, otherwise the user units don't really work.
Btw. daemon-reload did not help.

Maybe you should mention this as a hint in your beautiful tutorial.

((NB: the reboot was easier than session restart, as I was connected to a raspberry via ssh, ssh relogin did not suffice - b/c that did not terminate the user session I suppose))

@FlorianMuller
Copy link

I had the same problem, and I think running systemctl --user enable my_service weirdly solved it.
At this time I hadn't added the [Install] part so the enable command did not worked but after that the start worked 🤷🏻‍♂️

@torfsen
Copy link
Owner

torfsen commented Jun 12, 2020

@k-husmann: Thanks for the report!

It seems that you need to run systemctl --user daemon-reload before systemd really finds the new unit. Should be fixed as of #10.

@torfsen torfsen closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants