Saturday, November 20, 2010

Kernel patch that does wonders bash.

Here is how I am doing my bash script.
 (As explained here: www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html)


in ~/.bashrc


if [ "$PS1" ] ; then                                                                                                                               
    mkdir -m 0700 /cgroup/$$
    echo $$ > /cgroup/$$/tasks
    echo 1 > /cgroup/$$/notify_on_release
fi


in /etc/rc.local

mount -t cgroup cgroup /cgroup -o cpu
chmod 0777 /cgroup
echo "/sbin/rm_cgroup" > /cgroup/release_agent
in /sbin/rm_cgroup
#!/bin/sh
rmdir /cgroup/$1
then chmod +x /sbin/rm_cgroup and sudo mkdir /cgroup

Source.

No comments:

Post a Comment