Skip to content

Install.sh breaks on recent Debian versions without sudo #2528

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
tovine opened this issue Dec 29, 2020 · 0 comments · Fixed by #2529
Closed

Install.sh breaks on recent Debian versions without sudo #2528

tovine opened this issue Dec 29, 2020 · 0 comments · Fixed by #2529
Labels
bug Something isn't working
Milestone

Comments

@tovine
Copy link
Contributor

tovine commented Dec 29, 2020

When I tried to run the install.sh setup script on my Debian Buster machine, the dpkg step broke because it couldn't find ldconfig and start-stop-daemon. This is because of the way su is invoked (I don't use sudo).

See output from the installer log:

$ sh install.sh
Debian GNU/Linux 10 (buster)
Installing v3.8.0 deb package from GitHub releases.

+ mkdir -p ~/.cache/code-server
+ curl -#fL -o ~/.cache/code-server/code-server_3.8.0_amd64.deb.incomplete -C - https://github.com/cdr/code-server/releases/download/v3.8.0/code-server_3.8.0_amd64.deb
################################################################################################################################################################################################## 100.0%################################################################################################################################################################################################## 100.0%
+ mv ~/.cache/code-server/code-server_3.8.0_amd64.deb.incomplete ~/.cache/code-server/code-server_3.8.0_amd64.deb
+ su -c 'dpkg -i ~/.cache/code-server/code-server_3.8.0_amd64.deb'
Password:
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin

But both those executables are indeed present on my system:

# which start-stop-daemon
/usr/sbin/start-stop-daemon

and

# which ldconfig
/usr/sbin/ldconfig

The issue here is that the su version bundled with recent Debian versions has changed the default behavior so that the shell spawned is not by default a login shell if no user name i specified; therefore one must invoke it with su root or su - to get the expected behavior (that used to be the default).

After making this minor change to the setup script, everything works fine (PR incoming in a moment):

$ sh install.sh
Debian GNU/Linux 10 (buster)
Installing v3.8.0 deb package from GitHub releases.

+ Reusing ~/.cache/code-server/code-server_3.8.0_amd64.deb
+ su - -c 'dpkg -i ~/.cache/code-server/code-server_3.8.0_amd64.deb'
Password:
Selecting previously unselected package code-server.
(Reading database ... 148921 files and directories currently installed.)
Preparing to unpack .../code-server_3.8.0_amd64.deb ...
Unpacking code-server (3.8.0) ...
Setting up code-server (3.8.0) ...

To have systemd start code-server now and restart on boot:
  sudo systemctl enable --now code-server@$USER
Or, if you don't want/need a background service you can run:
  code-server
  • Web Browser: N/A
  • Local OS: N/A
  • Remote OS: Debian GNU/Linux 10 (buster)
  • Remote Architecture: amd64
  • code-server --version: 3.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants