From: <ta...@us...> - 2013-04-23 06:22:02
|
Revision: 8126 http://gfarm.svn.sourceforge.net/gfarm/?rev=8126&view=rev Author: tatebe Date: 2013-04-23 06:21:54 +0000 (Tue, 23 Apr 2013) Log Message: ----------- honor GFARM_CONFIG_FILE Modified Paths: -------------- gfarm2fs/trunk/contrib/mount.gfarm2fs/mount.hpci Modified: gfarm2fs/trunk/contrib/mount.gfarm2fs/mount.hpci =================================================================== --- gfarm2fs/trunk/contrib/mount.gfarm2fs/mount.hpci 2013-04-22 14:11:03 UTC (rev 8125) +++ gfarm2fs/trunk/contrib/mount.gfarm2fs/mount.hpci 2013-04-23 06:21:54 UTC (rev 8126) @@ -1,4 +1,8 @@ #!/bin/sh +# +# mount.hpci - mount HPCI shared storage +# +# this command assumes to be executed by a normal user not root ABORT() { [ $# -gt 0 ] && echo 1>&2 $* @@ -14,12 +18,6 @@ (gfln -s gfarm:///$LINK/$G/$U $LINK && echo create \'$LINK\' symlink) } -GFUSER=`gfwhoami` -[ X"$GFUSER" = X ] && ABORT 'Who?' -: ${USER:=`whoami`} -USERLIST="$GFUSER" -[ X"$GFUSER" != X"$USER" ] && USERLIST="$USERLIST $USER" - # check proxy cert grid-proxy-info > /dev/null || ABORT "Invalid proxy certificate" @@ -36,13 +34,22 @@ # display timeleft of proxy cert (grid-proxy-info || ABORT "Invalid proxy certificate") | grep timeleft +GFUSER=`gfwhoami` +[ X"$GFUSER" = X ] && ABORT 'Who?' +: ${USER:=`whoami`} +USERLIST="$GFUSER" +[ X"$GFUSER" != X"$USER" ] && USERLIST="$USERLIST $USER" + +: ${GFARM_CONFIG_FILE:=`gfstatus 2>/dev/null | grep "user config file" | sed 's/user config file : //'`} +: ${GFARM_CONFIG_FILE:="$HOME/.gfarm2rc"} + groups=`gfgroup -l | grep $GFUSER | awk -F: '{print $1}'` for g in $groups do for u in $USERLIST do [ -d /gfarm/$g/$u ] && { - env GFS_MOUNTDIR=/gfarm/$g/$u GFARMFS_ROOT=/home/$g/$GFUSER mount.gfarm2fs + env GFARMFS_ROOT=/home/$g/$GFUSER mount.gfarm2fs "$GFARM_CONFIG_FILE" /gfarm/$g/$u # create symlinks test $? -eq 0 && (cd /gfarm/$g/$u && { create_link www $g $GFUSER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |