Running code-server as systemd service on Ubuntu #3652
Answered
by
code-asher
mrducnguyen
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Hmmm 🤔 Maybe @code-asher or @oxy knows |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is just a guess but it might not be able to find `sh` since you
have overridden `PATH` (which is what is used to find binaries).
You might be able to just remove the `Environment` line entirely. Are
there binaries in `/home/user/coder` you need to be available?
If you do need `/home/user/coder` in the path you could try adding it to
your `~/.bashrc` or `~/.profile` instead. Something like:
```
PATH="/home/user/coder:$PATH"
```
If you really need it in the systemd file then you could try running
`printenv PATH` and then copy that into your systemd file (since you
can't use environment variables in `Environment` so the line above won't
work).
It might look something like this:
```
Environment="PATH=/home/user/coder:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
```
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
jsjoeio
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to run code-server as a systemd service on Ubuntu 20.04
Here's my service unit
But keep running into this error when I tried to start the service with:
systemctl start code-server
If I'm on a console window, logged in as user
user
, I can run this command/usr/bin/code-server --bind-addr 127.0.0.1:8888
without any issue andcode-server
is working properly.here's the user's line in
/etc/passwd
I'm confused. Not sure where to look at
Beta Was this translation helpful? Give feedback.
All reactions