Created
November 10, 2022 13:51
-
-
Save tvcam/653be3b7c922c4d05c4f1be8baeebeee to your computer and use it in GitHub Desktop.
Systemd shutting down when terminal is closed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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