Skip to content

Commit

Permalink
Merge pull request #541 from cam72cam/cam72cam-chown-home
Browse files Browse the repository at this point in the history
Support provisioned storage with incorrect permissions
  • Loading branch information
minrk authored Jan 31, 2018
2 parents 27ba573 + 272476e commit 29b68cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base-notebook/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ if [ $(id -u) == 0 ] ; then
# Handle username change. Since this is cheap, do this unconditionally
echo "Set username to: $NB_USER"
usermod -d /home/$NB_USER -l $NB_USER jovyan

# Handle case where provisioned storage does not have the correct permissions by default
# Ex: default NFS/EFS (no auto-uid/gid)
if [[ "$CHOWN_HOME" == "1" || "$CHOWN_HOME" == 'yes' ]]; then
echo "Changing ownership of /home/$NB_USER to $NB_UID:$NB_GID"
chown $NB_UID:$NB_GID /home/$NB_USER
fi

# handle home and working directory if the username changed
if [[ "$NB_USER" != "jovyan" ]]; then
Expand Down

0 comments on commit 29b68cd

Please sign in to comment.