1
1
#! /bin/bash
2
2
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
+
3
12
LPC_CONDOR_CONFIG=/etc/condor/config.d/01_cmslpc_interactive
4
13
LPC_CONDOR_LOCAL=/usr/local/bin/cmslpc-local-conf.py
5
14
@@ -12,18 +21,18 @@ if [ "$COMMAND_NAME" = "$(basename $LPC_CONDOR_LOCAL)" ]; then
12
21
fi
13
22
14
23
OSG_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)
16
25
17
26
LXP_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)
19
28
20
29
if [[ " $( 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}
22
31
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[@]} "
25
34
export APPTAINERENV_CONDOR_CONFIG=${OSG_CONDOR_CONFIG}
26
35
elif [[ " $( 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[@]} "
28
37
export APPTAINERENV_CONDOR_CONFIG=${LXP_CONDOR_CONFIG}
29
38
fi
0 commit comments