Git Product home page Git Product logo

cgroupfs-mount's Introduction

cgroupfs-mount

Light-weight package to set up cgroupfs mounts

Control groups are a kernel mechanism for tracking and imposing limits on resource usage on groups of tasks.

These scripts set up cgroups at boot without doing any cgroup management or doing any classification of tasks into cgroups.

Do I need this?

If you're using systemd as your init system, you do not need this, as systemd will already configure and manage a properly mounted cgroup hierarchy.

How do I install this?

For Debian users, simply apt-get install cgroupfs-mount.

If you're on Ubuntu 14.04 (Trusty), you should simply use cgroup-lite instead (the equivalent package this one was based upon).

If you're on Ubuntu 16.04 (Xenial) or later, you're likely using systemd already, and thus are unlikely to need this package.

If you're on some other distribution, either look for a similar package in your distribution's packages or clone these scripts and ensure that the cgroupfs-mount script is somehow invoked during system startup.

Troubleshooting

It is critically important for the proper operation of these scripts that you do not manually include any cgroup mount points in /etc/fstab. After commenting out any extraneous cgroup entries in /etc/fstab, you should either reboot or manually umount them and then run cgroupfs-mount again.

cgroupfs-mount's People

Contributors

debian-janitor avatar edwardbetts avatar g-m0n3y-2503 avatar paultag avatar tianon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cgroupfs-mount's Issues

cgroupfs-umount does not unmount /sys/fs/cgroup

cgroupfs-mount mounts /sys/fs/cgroup but cgroupfs-umount does not unmount it.

Is there any reason for that?
I've extended my script with an umount command.

diff --git a/cgroupfs-umount b/cgroupfs-umount
index 994b66e..13458f4 100644
--- a/cgroupfs-umount
+++ b/cgroupfs-umount
@@ -28,4 +28,10 @@ for sys in *; do
   fi
 done

+# unmount /sys/fs/cgroup
+cd /sys/fs
+if mountpoint -q /sys/fs/cgroup; then
+  umount /sys/fs/cgroup
+fi
+
 exit 0

mount: permission denied on debian (raspbian jessie)

I'm setting up a Docker image for AWS Greengrass, which requires cgroups directories to be mounted:
http://docs.aws.amazon.com/greengrass/latest/developerguide/gg-dg.pdf

Specifically (which actually appears to be out of date):

curl https://raw.githubusercontent.com/tianon/cgroupfsmount/951c38ee8d802330454bdede20d85ec1c0f8d312/cgroupfs-mount
> cgroupfs-mount.sh
chmod +x cgroupfs-mount.sh
sudo bash ./cgroupfs-mount.sh

In my Dockerfile, I'm using the apt-get install cgroupsfs-mount approach:

Step 9/15 : RUN sudo cgroupfs-mount
 ---> Running in cc187c3fb61f
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied
mount: permission denied

I added some debug echos, since it wasn't clear where the permission denied messages where coming from:

Step 10/16 : RUN sudo bash /app/cgroupfs-mount.sh
 ---> Running in ced257974766
making directory cpuset
cpuset not mounted
mount: permission denied
tried to mount cpuset, but failed, removing it
making directory cpu
cpu not mounted
mount: permission denied
tried to mount cpu, but failed, removing it
making directory cpuacct
cpuacct not mounted
mount: permission denied
tried to mount cpuacct, but failed, removing it
making directory blkio
blkio not mounted
mount: permission denied
tried to mount blkio, but failed, removing it
making directory memory
memory not mounted
mount: permission denied
tried to mount memory, but failed, removing it
making directory devices
devices not mounted
mount: permission denied
tried to mount devices, but failed, removing it
making directory freezer
freezer not mounted
mount: permission denied
tried to mount freezer, but failed, removing it
making directory net_cls
net_cls not mounted
mount: permission denied
tried to mount net_cls, but failed, removing it
making directory perf_event
perf_event not mounted
mount: permission denied
tried to mount perf_event, but failed, removing it
making directory net_prio
net_prio not mounted
mount: permission denied
tried to mount net_prio, but failed, removing it
making directory hugetlb
hugetlb not mounted
mount: permission denied
tried to mount hugetlb, but failed, removing it
making directory pids
pids not mounted
mount: permission denied
tried to mount pids, but failed, removing it

I'm not entirely sure what's going on here, or why the mount is failing, thoughts?

New version

There seems to be some really important additions like memory hierarchy that are unreleased. Can a new version be released, so it can be used by softwares like buildroot which is using v0.4?

suggestion to command rename

I request a suggestion that rename cgroups-mount/cgroups-umount to mount.cgroups/umount.cgroups, as a file system mount command naming routine under most linux distributions, like any other mount cmd, mount.cifs, mount.fuse, mount.glusterfs, mount.lowntfs-3g, mount.nfs, mount.nfs4, mount.ntfs, mount.ntfs-3g, mount.ploop.

Please add installation/usage instructions

I'm trying to get docker running on my Server running Ubuntu 14.04 and your package was mentioned as a possible solution to this problem.

However, I have no idea how to best install your package, could you elaborate in the README.md?

Project appears to be unlicensed

This source code doesn't have a license, as far as I can tell. According to https://choosealicense.com/no-permission/, a project without a license is "all rights reserved" and prohibits users from compiling/distributing binaries of this software. Please add a license. There is a relatively exhaustive list at https://choosealicense.com/appendix. Also, by adding a license this (depending on the license) allows third parties such as unix-like distributions to package this software and distribute binaries. Thank you for your consideration!
DISCLAIMER: I'm not a laywer, this isn't legal advice.

cgroupfs-mount script shows segmentation fault error

I am working on Android and tried to run this script to start docker daemon. but running script returns segmentation fault. it is not bounded to only one part of the code. i tried to comment one part and test next commands. on mounting commands it gives me segmentation fault.
Please help me through this issue,
thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.