r/linux • • Nov 18 '10

Alternative To The "200 Lines Kernel Patch That Does Wonders" Which You Can Use Right Away

http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html
244 Upvotes

154 comments sorted by

View all comments

2

u/placatedmayhem Nov 19 '10

There is a problem with the recommendation that this article makes with respect to the addition to the .bashrc. At the top of .bashrc (the default one on Ubuntu 10.10, at least), there is this line:

[ -z "$PS1" ] && return

This line causes the rest of the .bashrc to not get processed. So, at gdm login, the graphical session doesn't get added to the cgroup. The following is a hacked version of the article's .bashrc section which should fix the issues with respect to graphical logins, but it MUST come before the aforementioned return line in your .bashrc:

if [ "$PS1" -o "$0" = '/etc/gdm/Xsession' ] ; then 
    mkdir -m 0700 /dev/cgroup/cpu/user/$$
    echo $$ > /dev/cgroup/cpu/user/$$/tasks
    echo 1 > /dev/cgroup/cpu/user/$$/notify_on_release
fi