On 11/23/2010 11:56 AM, valent.turkovic(a)gmail.com wrote:
On Fri, Nov 19, 2010 at 8:27 PM, Konstantin
Svist<fry.kun(a)gmail.com> wrote:
> Try this one, instead (mostly from
http://lkml.org/lkml/2010/11/16/413)
>
> add to .bashrc:
>
> if [ "$PS1" ] ; then
> mkdir -m 0700 -p /cgroup/cpu/user/$$
> echo 1> /cgroup/cpu/user/$$/notify_on_release
> echo $$> /cgroup/cpu/user/$$/tasks
> fi
>
> create /bin/rmcgroup:
>
> #!/bin/bash
> rmdir /cgroup/cpu/$1
>
> add to /etc/rc.local:
>
> mount -t cgroup -o cpu none /cgroup/cpu
> mkdir -p -m 0777 /cgroup/cpu/user
> echo "/bin/rmcgroup"> /cgroup/cpu/release_agent
Should I edit .bashrc of root user or from my standard user account?
I try to use "mkdir -m 0700 -p /cgroup/cpu/user/$$" as standard user
but as expected don't have privileges to write in / directory :(
The 3 lines added to /etc/rc.local require a reboot to take effect.
Or you can also run those 3 lines as root if you don't want to reboot.
Although, without a reboot, only new TTY sessions will be grouped.
HTH