Shared installation (file access and permissions)

Typically: "How do I... ", "How can I... " questions
coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Shared installation (file access and permissions)

Post by coppelia »

Hello,

this is unfortunately not possible (for now). Best would be to adjust the settings for each user locally, then copy the system/usrset.txt file just before V-REP launch, in order to have differentiated settings depending on the users.

Cheers

t_groll
Posts: 9
Joined: 22 Jul 2014, 13:44

Re: Shared installation (file access and permissions)

Post by t_groll »

Okay I did this now. Here is my Start Script:
#!/bin/sh

arch="`uname -m`"

system="/opt/vrep/shared/system"
tmpfolder="/tmp/vrep"
localsettings="$HOME/.vrep"
usrset="usrset.txt"
settings="settings.dat"
instances="instances"
usrsetdefault="$system/userset_default.txt"
settingsdefault="$system/settings_default.dat"



if [ "x86_64" = "$arch" ]; then
dirname="/opt/vrep/64"
elif [ "i686" = "$arch" ]; then
dirname="/opt/vrep/32"
else
dirname=""
fi


if [ "$dirname" != "" ]; then
if [ ! -e "$localsettings" ]; then
mkdir "$localsettings"
fi
if [ ! -e "$localsettings/$usrset" ]; then
cp "$usrsetdefault" "$localsettings/$usrset"
fi
if [ ! -e "$localsettings/$settings" ]; then
cp "$settingsdefault" "$localsettings/$settings"
fi
if [ ! -e "$tmpfolder" ]; then
mkdir "$tmpfolder"
cp "$localsettings/$usrset" "$tmpfolder/"
cp "$localsettings/$settings" "$tmpfolder/"
echo "1" > "$tmpfolder/$instances"
else
echo "One Instance of v-rep is already running on this machine. Do you want to use the same config?"
echo "Y/n"
read answer
if [ "n" = "$answer" ]; then
exit 0
fi
echo "$((`cat $tmpfolder/$instances` + 1))" > "$tmpfolder/$instances"
fi
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$dirname
export LD_LIBRARY_PATH
cd "$dirname"
"$dirname/vrep" "$@"
cp "$tmpfolder/$usrset" "$localsettings/$usrset"
cp "$tmpfolder/$settings" "$localsettings/$settings"
if [ "`cat $tmpfolder/$instances`" = "1" ]; then
rm -rf "$tmpfolder"
else
echo "$((`cat $tmpfolder/$instances` - 1))" > "$tmpfolder/$instances"
fi

else
echo "A not supported plattform is used. Please use a x86_64 or i686 Linux system."
fi
It includes also a switch for 32 and 64bit system because in our IT configuration both architectures are used with same opt mount. The 32 bit version of v-rep is placed in /opt/vrep/32 and the 64bit in /opt/vrep/64. I moved the system directory otuside of the architecture directories (/opt/shared/system) and linked it into the directories of both versions. Additionally, the setting files has to be moved to default versions and symlinks to the tmp directory has to be created.

Post Reply