jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.02k stars 338 forks source link

/opt/tljh/user/bin not getting included in user PATH on Debian #926

Open kjmalek opened 1 year ago

kjmalek commented 1 year ago

Bug description

On Debian, opt/tljh/user/bin was not appended to the user's PATH when initialized with the Systemdspawner

To work around the issue, I need to modify /etc/profile to include the environment in the PATH.

Expected behaviour

On Ubuntu installs, the user's PATH is properly set and enables users to use Conda along with any packages installed in the user environment.

$ echo $PATH
/opt/tljh/user/bin:/usr/local/bin:/usr/bin:/bin ...

Actual behaviour

On Debian installs, users do not have default access to Conda and packages installed in the user environment from the terminal.

$ echo $PATH
/usr/local/bin:usr/bin:/bin ...

How to reproduce

  1. Install TLJH 1.0.0b1 on a fresh Debian VM
  2. Access JupyterHub as an admin
  3. Open a new terminal
  4. Run echo $PATH

Your personal set up

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

kjmalek commented 1 year ago

This bug appears to be getting caused by the order in which Debian sets environment variables as documented here: https://wiki.debian.org/EnvironmentVariables. All other environment variables created by the SystemdSpawner are getting appropriately set, but upon starting the shell in JupyterLab, Debian overrides the systemd service PATH environment variable with the PATH variable set within '/etc/profile'. To address the issue, you can either modify '/etc/profile' to append '/opt/tljh/user/bin' or create a '.bash_profile' within each Jupyter users home directory that updates the PATH.