Created
November 30, 2015 12:07
-
-
Save feitang0/5fdca2ef0ec30b486fe0 to your computer and use it in GitHub Desktop.
Devices cgroup isn't mounted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From: https://github.com/docker/docker/issues/8791 | |
cgroupfs_mount() { | |
# see also https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount | |
if grep -v '^#' /etc/fstab | grep -q cgroup \ | |
|| [ ! -e /proc/cgroups ] \ | |
|| [ ! -d /sys/fs/cgroup ]; then | |
return | |
fi | |
if ! mountpoint -q /sys/fs/cgroup; then | |
mount -t tmpfs -o uid=0,gid=0,mode=0755 cgroup /sys/fs/cgroup | |
fi | |
( | |
cd /sys/fs/cgroup | |
for sys in $(awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do | |
mkdir -p $sys | |
if ! mountpoint -q $sys; then | |
if ! mount -n -t cgroup -o $sys cgroup $sys; then | |
rmdir $sys || true | |
fi | |
fi | |
done | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks.. Your code can help fixed the issue...
I spend time more than 2 hour find how to fixed. but it cannot until I found your code.