Skip to content

Instantly share code, notes, and snippets.

@tvcam
Created November 10, 2022 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvcam/653be3b7c922c4d05c4f1be8baeebeee to your computer and use it in GitHub Desktop.
Save tvcam/653be3b7c922c4d05c4f1be8baeebeee to your computer and use it in GitHub Desktop.
Systemd shutting down when terminal is closed
You’re running the service from your user manager (--user), and apparently your logind doesn’t have lingering enabled for you. As a result, your session (including any services started inside it) is closed down whenever you log out.
To change this behaviour, you need to enable lingering:
`sudo loginctl enable-linger $USER`
This will start a user manager for you at boot and allow your services to survive your login sessions.
A better approach for a system service such as this is really to run it as its own user, managed by the main systemd instance.
ref: https://unix.stackexchange.com/a/522554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment