11#! /bin/bash
22
3+ bind_if_exists (){
4+ for ITEM in " $@ " ; do
5+ TESTITEM=" ${ITEM%%:* } "
6+ if [ -e " $TESTITEM " ]; then
7+ export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND: +,}${ITEM}
8+ fi
9+ done
10+ }
11+
312LPC_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive
413LPC_CONDOR_LOCAL=/usr/local/bin/cmslpc-local-conf.py
514
@@ -12,18 +21,18 @@ if [ "$COMMAND_NAME" = "$(basename $LPC_CONDOR_LOCAL)" ]; then
1221fi
1322
1423OSG_CONDOR_CONFIG=/etc/condor/condor_config
15- OSG_CONDOR_LOCAL=/usr/share/condor/config.d, /etc/condor/config.d
24+ OSG_CONDOR_LOCAL=( /usr/share/condor/config.d /etc/condor/config.d)
1625
1726LXP_CONDOR_CONFIG=/etc/condor/condor_config
18- LXP_CONDOR_LOCAL=/etc/condor/config.d, /usr/bin/myschedd.sh, /usr/bin/myschedd, /etc/myschedd
27+ LXP_CONDOR_LOCAL=( /etc/condor/config.d /usr/bin/myschedd.sh /usr/bin/myschedd /etc/myschedd)
1928
2029if [[ " $( uname -a) " == * cms* .fnal.gov* ]]; then
21- export APPTAINER_BIND= ${APPTAINER_BIND}${APPTAINER_BIND : +,}${ LPC_CONDOR_CONFIG}, ${LPC_CONDOR_LOCAL} :${LPC_CONDOR_LOCAL} .orig, ${COMMAND_PATH} :${LPC_CONDOR_LOCAL}
30+ bind_if_exists ${ LPC_CONDOR_CONFIG} ${LPC_CONDOR_LOCAL} :${LPC_CONDOR_LOCAL} .orig " ${COMMAND_PATH} " :${LPC_CONDOR_LOCAL}
2231 export APPTAINERENV_CONDOR_CONFIG=${LPC_CONDOR_CONFIG}
23- elif [[ " $( uname -a) " == * .uscms.org* ]] || [[ " $( uname -a) " == * .osg-htc.org* ]]; then
24- export APPTAINER_BIND= ${APPTAINER_BIND}${APPTAINER_BIND : +,}${ OSG_CONDOR_CONFIG}, ${OSG_CONDOR_LOCAL}
32+ elif [[ " $( uname -a) " == * .uscms.org* ]] || [[ " $( uname -a) " == * .osg-htc.org* ]] || [[ " $( uname -a ) " == * cmscon.hep.wisc.edu * ]] ; then
33+ bind_if_exists ${ OSG_CONDOR_CONFIG} " ${OSG_CONDOR_LOCAL[@]} "
2534 export APPTAINERENV_CONDOR_CONFIG=${OSG_CONDOR_CONFIG}
2635elif [[ " $( uname -a) " == * lxplus* .cern.ch* ]]; then
27- export APPTAINER_BIND= ${APPTAINER_BIND}${APPTAINER_BIND : +,}${ LXP_CONDOR_CONFIG}, ${LXP_CONDOR_LOCAL}
36+ bind_if_exists ${ LXP_CONDOR_CONFIG} " ${LXP_CONDOR_LOCAL[@]} "
2837 export APPTAINERENV_CONDOR_CONFIG=${LXP_CONDOR_CONFIG}
2938fi
0 commit comments