Skip to content

Commit e463c64

Browse files
Run doorman with better error checking; do not remove gendel yet
1 parent 6472f92 commit e463c64

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

parm/globus/run_doorman.sh.j2

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [[ -f /etc/bashrc ]]; then
1111
fi
1212

1313
run_doorman(){
14-
set -eux
14+
set -ux
1515

1616
rm -f dm.conf
1717
rm -f places.inc
@@ -64,7 +64,7 @@ while IFS= read -r line; do
6464
tmp="${package_name#package_location_}"
6565
ID="${tmp%.tgz}"
6666
IDs="${IDs} ${ID}"
67-
done < FLIST
67+
done < <(grep "package_location" FLIST)
6868

6969
set +e
7070

@@ -102,24 +102,15 @@ if [[ ${send_stat} -ne 0 ]]; then
102102
return 5
103103
fi
104104

105-
# Remove the working directory
106-
#shellcheck disable=SC2050
107-
if [[ "{{KEEPDATA}}" == "False" || "{{KEEPDATA}}" == "NO" ]]; then
108-
if ! cd "${HOME}"; then
109-
echo "Failed to navigate to ${HOME}!"
110-
return 6
111-
fi
112-
rm -rf "${gendel}"
113-
fi
114-
115105
set +eux
116106
}
117107

118-
run_doorman >& "${log_file}"
108+
# Run the function, halting the function on errors, and capture the output
109+
( set -e; run_doorman ) >& "${log_file}"
110+
doorman_stat=$?
119111

120-
if [[ $? -ne 0 ]]; then
112+
if [[ ${doorman_stat} -ne 0 ]]; then
121113
echo "Failed to run the doorman service!"
122-
set +eux
123114
echo "FAILURE" >> "${log_file}"
124115
exit 9
125116
fi

0 commit comments

Comments
 (0)