diff --git a/smartgears/r_connector/defaults/main.yml b/smartgears/r_connector/defaults/main.yml index af47ee31..25828362 100644 --- a/smartgears/r_connector/defaults/main.yml +++ b/smartgears/r_connector/defaults/main.yml @@ -1,7 +1,7 @@ --- gcube_repository: 'gcube-staging' r_connector_install: False -r_connector_ver: 2.1.2-4.3.0-144071 +r_connector_ver: 2.1.3-4.4.0-146364 r_connector_name: r-connector r_connector_group_id: org.gcube.data.analysis r_connector_extension: war diff --git a/smartgears/r_connector/templates/rusersadd.j2 b/smartgears/r_connector/templates/rusersadd.j2 index 009b716b..1853a4b6 100755 --- a/smartgears/r_connector/templates/rusersadd.j2 +++ b/smartgears/r_connector/templates/rusersadd.j2 @@ -10,11 +10,18 @@ ALLOW_LOCAL_USERS=1 RPROFILE_FILE='{{ r_connector_rprofile_path }}/{{ r_connector_rprofile_filename }}' if [ -d $HDIR ] ; then - logger "$LOG_PREFIX user $HDIR directory exists" - sudo /usr/bin/touch ${HDIR}/{{ r_connector_userconfig }} - sudo /bin/chown ${USER}:{{ smartgears_user }} $HDIR/{{ r_connector_userconfig }} - sudo /usr/bin/setfacl -m u:${USER}:rw,g:{{ smartgears_user }}:rw $HDIR/{{ r_connector_userconfig }} - exit 0 + if id -u $USER >/dev/null 2>&1 + then + logger "$LOG_PREFIX user $HDIR directory exists. Touching the userconfig.csv file to ensure that it exists with the correct permissions" + sudo /usr/bin/touch ${HDIR}/{{ r_connector_userconfig }} + sudo /bin/chown ${USER}:{{ smartgears_user }} $HDIR/{{ r_connector_userconfig }} + sudo /usr/bin/setfacl -m u:${USER}:rw,g:{{ smartgears_user }}:rw $HDIR/{{ r_connector_userconfig }} + sudo /bin/ln -s $RPROFILE_FILE $HDIR/{{ r_connector_rprofile_filename }} + exit 0 + else + logger "$LOG_PREFIX user $HDIR directory exists but the user not. Aborting." + exit 1 + fi else if id -u $USER >/dev/null 2>&1 then