diff --git a/02_userconf.sh b/02_userconf.sh index 66bcf2a..9831fe2 100644 --- a/02_userconf.sh +++ b/02_userconf.sh @@ -64,8 +64,7 @@ if [ "$USERID" -ne 1000 ] elif [ "$USER" != "$DEFAULT_USER" ] then ## cannot move home folder when it's a shared volume, have to copy and change permissions instead - #cp -r /home/$DEFAULT_USER/.??* /home/$USER || true - cp -r /home/$DEFAULT_USER /home/$USER + cp -r /home/$DEFAULT_USER/.??* /home/$USER || true ## RENAME the user usermod -l $USER -d /home/$USER $DEFAULT_USER groupmod -n $USER $DEFAULT_USER diff --git a/05_setup_rsession_parameters.sh b/05_setup_rsession_parameters.sh index 69a7e5a..bacdb6d 100644 --- a/05_setup_rsession_parameters.sh +++ b/05_setup_rsession_parameters.sh @@ -3,8 +3,8 @@ echo "session-timeout-minutes=7200" >> /etc/rstudio/rsession.conf echo "session-disconnected-timeout-minutes=1440" >> /etc/rstudio/rsession.conf echo "session-quit-child-processes-on-exit=0" >> /etc/rstudio/rsession.conf -echo "session-default-working-dir=~/rstudio" >> /etc/rstudio/rsession.conf -echo "session-default-new-project-dir=~/rstudio" >> /etc/rstudio/rsession.conf +echo "session-default-working-dir=~" >> /etc/rstudio/rsession.conf +echo "session-default-new-project-dir=~" >> /etc/rstudio/rsession.conf #echo "session-save-action-default=yes" >> /etc/rstudio/rsession.conf echo "allow-shell=1" >> /etc/rstudio/rsession.conf #echo "allow-terminal-websockets=1" >> /etc/rstudio/rsession.conf diff --git a/06_workspace_mount.sh b/06_workspace_mount.sh index 8e8ef46..2963402 100644 --- a/06_workspace_mount.sh +++ b/06_workspace_mount.sh @@ -42,13 +42,23 @@ fi echo "Mount the workspace" su - "$USER" -c "/usr/bin/java -cp .:${workspace_dir}:${workspace_logdir}/ -Dlogback.configurationFile=${workspace_logdir}/logback.xml -jar $workspace_fuse_jar $SHINYPROXY_OIDC_ACCESS_TOKEN ${_workspace_scope} $workspace_dir" >/dev/null 2>&1 & +sleep 5 _retval= _fuse_process=$(ps auwwx | grep fuse | grep java) _retval=$? if [ $_retval -ne 0 ]; then echo "The mount of the workspace failed" exit 1 +else + pushd /home/${USER} + if [ $? -ne 0 ]; then + if ! [ -L workspace ]; then + su - "$USER" -c "ln -s $workspace_dir /workspace" + fi + else + echo "Cannot cd inside the user's home directory" + exit 1 + fi + echo "The workspace has been mounted" + exit 0 fi - -ln -sf $workspace_dir /home/${USER}/workspace -exit 0