Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Start by editing your rc.local file, running sudo gedit /etc/rc.local and add the following lines above "exit 0":
- mkdir -p /dev/cgroup/cpu
- mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
- mkdir -m 0777 /dev/cgroup/cpu/user
- echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
- Save and exit gedit. Now, make it executable:
- sudo chmod +x /etc/rc.local
- After doing this, edit the .bashrc file found in your home directory (gedit ~/.bashrc) and, at the end of this file, add:
- if [ "$PS1" ] ; then
- mkdir -m 0700 /dev/cgroup/cpu/user/$$
- echo $$ > /dev/cgroup/cpu/user/$$/tasks
- echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
- fi
- One last thing. To make sure that cgroups are deleted whenever the last task leaves, run:
- sudo gedit /usr/local/sbin/cgroup_clean
- And copy-paste this:
- #!/bin/sh
- rmdir /dev/cgroup/cpu/$*
- Once again, save the file, exit gedit and make it executable:
- sudo chmod +x /usr/local/sbin/cgroup_clean
- Done! Restart your computer to apply the changes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement