Skip to content

Commit ccd3210

Browse files
committed
Detect step cgroup when running under Slurm
Fixes: #169
1 parent 61e6c02 commit ccd3210

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

conf/hooks/10-cgroups.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ while IFS=':' read -r x ctrl path; do
2525
fi < /proc/self/mountinfo | { IFS=' ' read -r x x x root mount x || :; }
2626

2727
if [ -n "${root}" ] && [ -n "${mount}" ]; then
28-
printf "%s %s none x-create=dir,rbind,nosuid,noexec,nodev,ro\n" "${mount}/${path#${root}}" "${mount}" >> "${ENROOT_MOUNTS}"
28+
subtree="${mount}/${path#${root}}${SLURM_STEP_ID:+/..}"
29+
printf "%s %s none x-create=dir,rbind,nosuid,noexec,nodev,ro\n" "${subtree}" "${mount}" >> "${ENROOT_MOUNTS}"
2930
fi
3031
done < /proc/self/cgroup
3132

0 commit comments

Comments
 (0)