Code-server: FYI: 3.2.0 seems to be the last working version

Created on 29 May 2020  路  18Comments  路  Source: cdr/code-server

I'm on Centos7 if that makes a difference. Nice clean fresh install.

Most helpful comment

@nhooyr Ahh, I see what you mean. Interesting. In my case I just put it in system since both system and user units require root access to access the appropriate path, but I'm using code-server entirely different from the vision of code-server Enterprise. ;-)

All 18 comments

Yes, that is because of the glibc requirement of 2.18. There has been a lot of pain for those of us that work somewhere that isn't on the bleeding edge RHEL/Centos distribution.

PLEASE make the minimum required at least 2.17 or lower. I keep having to downgrade every new release after hoping the glibc/libstdc++ versions have been fixed. :-(

ah, if that is indeed the problem then maybe this will help:

from https://unix.stackexchange.com/questions/176608/cannot-update-glibc-on-centos-7#176613

Update your CentOS7, do a yum install of apr (apr-devel too?) and you're done.

I'm in crunch mode and can't deal with the whirlwind

@captainwasabi I already have glibc 2.17, but code-server 3.4.0 is requiring 2.18.
Regardless, I do not have root access, nor would they allow an upgrade of glibc even if it was available for RHEL 7.x.

Service still doesn't work.

...~]$ curl -fsSL https://code-server.dev/install.sh | sh
CentOS Linux 7 (Core)
Installing v3.4.1 rpm package from GitHub releases.

+ curl -#fL -o ~/.cache/code-server/code-server-3.4.1-amd64.rpm.incomplete -C - https://github.com/cdr/code-server/releases/download/v3.4.1/code-server-3.4.1-amd64.rpm
######################################################################## 100.0%
+ mv ~/.cache/code-server/code-server-3.4.1-amd64.rpm.incomplete ~/.cache/code-server/code-server-3.4.1-amd64.rpm
+ sudo rpm -i ~/.cache/code-server/code-server-3.4.1-amd64.rpm
[sudo] password for user:

To have systemd start code-server now and restart on boot:
  systemctl --user enable --now code-server
Or, if you don't want/need a background service you can run:
  code-server

...~]$ systemctl --user enable --now code-server
Failed to get D-Bus connection: No such file or directory

...~]$ sudo systemctl --user enable --now code-server
Failed to get D-Bus connection: No such file or director


...~]$ code-server
info  Wrote default config file to ~/.config/code-server/config.yaml
info  Using config file ~/.config/code-server/config.yaml
info  Using user-data-dir ~/.local/share/code-server
info  code-server 3.4.1 48f7c2724827e526eeaa6c2c151c520f48a61259
info  HTTP server listening on http://127.0.0.1:8080
info      - Using password from ~/.config/code-server/config.yaml
info      - To disable use `--auth none`
info    - Not serving HTTPS

Hmm. At the very least it's not related to the libraries so that's fixed. Looks like something wrong with systemd? Do you see the service in /usr/lib/systemd/user/code-server.service?

I'll give it a whirl with CentOS 7 on GCP.

@nhooyr No need, I've been using it on RHEL 7.8 (Maipo) for the past few hours. It works perfectly. Thanks!

@captainwasabi Not sure what happened with your setup, but I use Code-Server with a systemd config and it works fine for me. Lmk if you want my config file.

It looks like CentOS 7's systemd version is old enough that it has bugs with user units :(

I think we'll ship a templated global unit then as well.

@nhooyr @captainwasabi This is my systemd config:

[Unit]
Description=VSCode Server IDE
After=network.target

[Service]
Type=simple
User=popadmin
EnvironmentFile=$HOME/.profile
WorkingDirectory=$HOME
Restart=on-failure
RestartSec=10

ExecStart=/home/popadmin/code-server-current/code-server --host 127.0.0.1 $(pwd)

StandardOutput=file:/home/popadmin/code-server-current/log/code-server-output.log
StandardError=file:/home/popadmin/code-server-current/log/code-server-error.log

[Install]
WantedBy=multi-user.target

Note: $HOME does not work correctly (resolves to root's $HOME since that's what it's being invoked as, but that is not a bug, that is by design.

@nbetcher nice! That looks good to me.

For anyone who just wants to use the bundled service, 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.

@nhooyr What is the bug with User units? My process is running as the user defined in my config, or is this a CentOS specific issue (despite that it's basically RHEL)?

@nbetcher Not entirely sure, appears to be CentOS specific issue. I didn't look into it fully yet.

A user unit is different from specifying the user in the service. See https://wiki.archlinux.org/index.php/Systemd/User

@nhooyr Ahh, I see what you mean. Interesting. In my case I just put it in system since both system and user units require root access to access the appropriate path, but I'm using code-server entirely different from the vision of code-server Enterprise. ;-)

sudo cp /usr/lib/systemd/user/code-server.service /etc/systemd/system
sudo vim /etc/systemd/system/code-server.service
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

I think the vim line is unnecessary?

Yea, nice catch, removed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

infogulch picture infogulch  路  3Comments

KSXGitHub picture KSXGitHub  路  3Comments

balazssoltesz picture balazssoltesz  路  3Comments

RealSlimMahdi picture RealSlimMahdi  路  3Comments

justmao945 picture justmao945  路  3Comments