Commit 29b68cd9 authored by Min RK's avatar Min RK Committed by GitHub

Merge pull request #541 from cam72cam/cam72cam-chown-home

Support provisioned storage with incorrect permissions
parents 27ba5736 272476e2
...@@ -17,6 +17,13 @@ if [ $(id -u) == 0 ] ; then ...@@ -17,6 +17,13 @@ if [ $(id -u) == 0 ] ; then
# Handle username change. Since this is cheap, do this unconditionally # Handle username change. Since this is cheap, do this unconditionally
echo "Set username to: $NB_USER" echo "Set username to: $NB_USER"
usermod -d /home/$NB_USER -l $NB_USER jovyan 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 # handle home and working directory if the username changed
if [[ "$NB_USER" != "jovyan" ]]; then if [[ "$NB_USER" != "jovyan" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment