Advertisement
Guest User

Ricardo

a guest
Nov 18th, 2010
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. Start by editing your rc.local file, running sudo gedit /etc/rc.local and add the following lines above "exit 0":
  2.  
  3. mkdir -p /dev/cgroup/cpu
  4. mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
  5. mkdir -m 0777 /dev/cgroup/cpu/user
  6. echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
  7.  
  8. Save and exit gedit. Now, make it executable:
  9.  
  10. sudo chmod +x /etc/rc.local
  11.  
  12. After doing this, edit the .bashrc file found in your home directory (gedit ~/.bashrc) and, at the end of this file, add:
  13.  
  14. if [ "$PS1" ] ; then
  15. mkdir -m 0700 /dev/cgroup/cpu/user/$$
  16. echo $$ > /dev/cgroup/cpu/user/$$/tasks
  17. echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
  18. fi
  19.  
  20. One last thing. To make sure that cgroups are deleted whenever the last task leaves, run:
  21.  
  22. sudo gedit /usr/local/sbin/cgroup_clean
  23.  
  24. And copy-paste this:
  25.  
  26. #!/bin/sh
  27. rmdir /dev/cgroup/cpu/$*
  28.  
  29. Once again, save the file, exit gedit and make it executable:
  30.  
  31. sudo chmod +x /usr/local/sbin/cgroup_clean
  32.  
  33. Done! Restart your computer to apply the changes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement