diff --git a/base-notebook/start.sh b/base-notebook/start.sh index cbf474e7..052c9fb2 100755 --- a/base-notebook/start.sh +++ b/base-notebook/start.sh @@ -93,9 +93,14 @@ if [ "$(id -u)" == 0 ] ; then # home directory as a fallback if they don't have one mounted already. if [[ "${NB_USER}" != "jovyan" ]]; then if [[ ! -e "/home/${NB_USER}" ]]; then - echo "Copying home dir to /home/${NB_USER}" + echo "Attempting to copy /home/jovyan to /home/${NB_USER}..." mkdir "/home/${NB_USER}" - cp -a /home/jovyan/. "/home/${NB_USER}/" || ln -s /home/jovyan "/home/${NB_USER}" + if cp -a /home/jovyan/. "/home/${NB_USER}/"; then + echo "Done" + else + echo "Failed. Attempting to symlink /home/jovyan to /home/${NB_USER}..." + ln -s /home/jovyan "/home/${NB_USER}" && echo "Done" + fi fi # Ensure the current working directory is updated if [[ "${PWD}/" == "/home/jovyan/"* ]]; then