Commit 03835a1f authored by Maiken's avatar Maiken

Merge branch 'fix-python-lrms-ssh-config-vars' into 'master'

Adapt python lrms ssh configuration variables to ARC 6 naming scheme.

See merge request nordugrid/arc!159
parents 5a31b4e0 13bb7c20
......@@ -845,7 +845,7 @@ start() {
fi
# If specified in configuration mount remote session directory using SSHFS.
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" ssh remote_host`
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_host`
if test "x$REMOTE_HOST" != "x"; then
if test ! -f $ARC_LOCATION/@pkglibexecsubdir@/arc-sshfs-mount; then
log_failure_msg "Unable to locate SSHFS mount script. Is the nordugrid-arc-arex-ssh package installed?"
......@@ -915,7 +915,7 @@ stop() {
# If specified in configuration and if mounted,
# unmount remote session, runtime and cache directories.
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" ssh remote_host`
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_host`
if test "x${REMOTE_HOST}" != "x"; then
if test ! -f $ARC_LOCATION/@pkglibexecsubdir@/arc-sshfs-mount; then
log_failure_msg "Unable to locate SSHFS mount script. Is the nordugrid-arc-arex-ssh package installed?"
......@@ -978,7 +978,7 @@ case "$1" in
validate
;;
mount-sshfs)
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" ssh remote_host`
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_host`
if test "x$REMOTE_HOST" != "x"; then
if test ! -f $ARC_LOCATION/@pkglibexecsubdir@/arc-sshfs-mount; then
log_failure_msg "Unable to locate SSHFS mount script. Is the nordugrid-arc-arex-ssh package installed?"
......
......@@ -7,11 +7,11 @@
mount_sshfs() {
# Read from arc.conf
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" ssh remote_host`
REMOTE_USER=`readconfigvar "$ARC_CONFIG" ssh remote_user`
SSH_TIMEOUT=`readconfigvar "$ARC_CONFIG" ssh ssh_timeout`
IDENTITY_FILE=`readconfigvar "$ARC_CONFIG" ssh private_key`
GRIDMAP=`readconfigvar "$ARC_CONFIG" common gridmap`
REMOTE_HOST=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_host`
REMOTE_USER=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_user`
SSH_TIMEOUT=`readconfigvar "$ARC_CONFIG" lrms/ssh ssh_timeout`
IDENTITY_FILE=`readconfigvar "$ARC_CONFIG" lrms/ssh private_key`
GRIDMAP=`readconfigvar "$ARC_CONFIG" common/mapping gridmap`
# Get user and group id and save to mapfiles
user=`head -1 $GRIDMAP | sed 's/^"[^"]*" //'`
IDMAPDIR=`mktemp -d`
......@@ -21,8 +21,8 @@ mount_sshfs() {
printf "%s:%s\n" "`id -g -n ${user}`" "`ssh -i ${IDENTITY_FILE} ${REMOTE_USER}@${REMOTE_HOST} "id -g"`" > ${GIDF}
for MOUNTDIR in sessiondir runtimedir cachedir; do
LOCALDIR=`readconfigvar "$ARC_CONFIG" grid-manager ${MOUNTDIR}`
REMOTEDIR=`readconfigvar "$ARC_CONFIG" ssh remote_${MOUNTDIR}`
LOCALDIR=`readconfigvar "$ARC_CONFIG" arex ${MOUNTDIR}`
REMOTEDIR=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_${MOUNTDIR}`
if [ -z ${REMOTEDIR} ]; then
log_failure_msg "Directory attribute remote_${MOUNTDIR} not set in ${ARC_CONFIG}"
RETVAL=1
......@@ -72,8 +72,8 @@ mount_sshfs() {
unmount_sshfs() {
for MOUNTDIR in sessiondir runtimedir cachedir; do
LOCALDIR=`readconfigvar "$ARC_CONFIG" grid-manager ${MOUNTDIR}`
REMOTEDIR=`readconfigvar "$ARC_CONFIG" ssh remote_${MOUNTDIR}`
LOCALDIR=`readconfigvar "$ARC_CONFIG" arex ${MOUNTDIR}`
REMOTEDIR=`readconfigvar "$ARC_CONFIG" lrms/ssh remote_${MOUNTDIR}`
if [ ! -z ${REMOTEDIR} ] && [ "$(mount | grep ${LOCALDIR})" ]; then
timeout 10 fusermount -u ${LOCALDIR} > /dev/null
if [ $? != 0 ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment