Skip to content

Commit

Permalink
Restrict removal to cgroup mountpoints created by these scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
TanyaEleventhGoddess authored and Tanya committed Jun 29, 2020
1 parent 794b827 commit e5db883
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cgroupfs-umount
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ fi
cd /sys/fs/cgroup

for sys in *; do
if mountpoint -q $sys; then
umount $sys
fi
if [ -d $sys ]; then
rmdir $sys || true
# Solves https://bugs.debian.org/950986
if grep -q $sys /proc/cgroups 2>/dev/null || [ $sys = 'systemd' ]; then
if mountpoint -q $sys; then
umount $sys
fi
if [ -d $sys ]; then
rmdir $sys || true
fi
fi
done

Expand Down

0 comments on commit e5db883

Please sign in to comment.