-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Ship a templated system systemd unit #1771
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
Comments
Should also switch from For anyone who just wants to use the bundled service now, you can easily fix by running: sudo cp /usr/lib/systemd/user/code-server.service /etc/systemd/system
sudo sed -i "s/\(Restart=always\)/\1\nUser=$USER/" /etc/systemd/system/code-server.service
sudo systemctl daemon-reload
sudo systemctl enable --now code-server It'll make code-server a system service and add your current user into the service file and start it for you. |
To be clear, the above will fix errors similar to "Failed to get D-Bus connection" which is what happens when using a user unit on an old version of systemd. |
@nhooyr Thanks for your solution. After run above cmd, I successed created symlink in default.target, but I can't start code-server, until I change the line 'User=$USER' in code-server.service to 'User=admin' with a real username , and its failed status below:
So I want to know the cmd
should replace single quote with double quote to add the current real username.
|
@yaerda Great catch! |
systemd's user services are too immature. See #1771
systemd's user services are too immature. See #1771
systemd's user services are too immature. Closes #1771
So the reason I couldn't reproduce before is I use ssh connection sharing which kept my ssh connection open even after I exited. So definitely need this to fix that. |
systemd's user units are buggy on certain versions and do not linger by default. Closes #1771
Older versions of systemd have problems with the user unit.
See #1747 (comment)
The text was updated successfully, but these errors were encountered: