Skip to content

Commit

Permalink
Only create symlink /share if /home/share exists (#125)
Browse files Browse the repository at this point in the history
We never added a `/home/share` and don't intend to create one, so this
makes the existing prologue work without issue for our scenario. Without
this, the prologue always creates a "dead" symlink that points to a
non-existent directory, which appears broken in the JupyterHub notebook
interface as well.

Co-authored-by: Steven DeMartini <[email protected]>
  • Loading branch information
sjdemartini and sjdemartini authored Apr 21, 2022
1 parent 4c66c58 commit 662a889
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/jupyterhub/templates/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ class QHubHPCSpawner(QHubHPCSpawnerBase):
c.QHubHPCSpawner.req_nprocs = '1'
c.QHubHPCSpawner.req_conda_environment_prefix = '{{ miniforge_home }}/envs/{{ jupyterhub_lab_environment | basename | splitext | first }}'
c.QHubHPCSpawner.req_prologue = '''
# ensure user has link to shared directory
if [ ! -L "$HOME/share" ]; then
# ensure user has link to the shared directory, if it exists
if [ -d "/home/share" ] && [ ! -L "$HOME/share" ]; then
ln -s /home/share "$HOME/share"
fi
Expand Down

0 comments on commit 662a889

Please sign in to comment.