Skip to content

FYI: 3.2.0 seems to be the last working version #1747

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

Closed
captainwasabi opened this issue May 29, 2020 · 18 comments
Closed

FYI: 3.2.0 seems to be the last working version #1747

captainwasabi opened this issue May 29, 2020 · 18 comments

Comments

@captainwasabi
Copy link

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

@nbetcher
Copy link

nbetcher commented Jun 1, 2020

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. :-(

@captainwasabi
Copy link
Author

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

@nbetcher
Copy link

nbetcher commented Jun 1, 2020

@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.

@nhooyr
Copy link
Contributor

nhooyr commented Jun 3, 2020

Will be fixed soon. See #1738

@nhooyr nhooyr closed this as completed Jun 3, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

@captainwasabi
Copy link
Author

captainwasabi commented Jun 4, 2020

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

@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

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?

@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

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

@nbetcher
Copy link

nbetcher commented Jun 4, 2020

@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.

@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

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
Copy link
Contributor

nhooyr commented Jun 4, 2020

Opened #1771

@nbetcher
Copy link

nbetcher commented Jun 4, 2020

@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.

@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

@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.

@nbetcher
Copy link

nbetcher commented Jun 4, 2020

@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)?

@nhooyr
Copy link
Contributor

nhooyr commented Jun 4, 2020

@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

@nbetcher
Copy link

nbetcher commented Jun 4, 2020

@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. ;-)

@captainwasabi
Copy link
Author

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?

@nhooyr
Copy link
Contributor

nhooyr commented Jun 5, 2020

Yea, nice catch, removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants