Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create systemd cgroup if not present #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cgroupfs-mount
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
fi
done

# Create systemd cgroup if not present
# https://bugs.devuan.org/426
# https://bugs.debian.org/939435
mkdir -p systemd
if ! mountpoint -q systemd; then
if ! mount -n -t cgroup -o none,name=systemd cgroup systemd; then
rmdir systemd || true
fi
fi

# example /proc/cgroups:
# #subsys_name hierarchy num_cgroups enabled
# cpuset 2 3 1
Expand Down
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