Linux
shell †
$ cd
$ wget http://launchpadlibrarian.net/59511828/cgroup_patch
--2010-11-28 11:46:41-- http://launchpadlibrarian.net/59511828/cgroup_patch
launchpadlibrarian.net をDNSに問いあわせています... 91.189.89.229, 91.189.89.228
launchpadlibrarian.net|91.189.89.229|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 3476 (3.4K) [text/plain]
`cgroup_patch' に保存中
100%[======================================>] 3,476 13.2K/s 時間 0.3s
2010-11-28 11:46:41 (13.2 KB/s) - `cgroup_patch' へ保存完了 [3476/3476]
$ chmod +x cgroup_patch
$ sudo ./cgroup_patch
[sudo] password for yusuke:
Patching [/home/yusuke/.bashrc]...
Adding the patch...
if [ "$PS1" ] ; then
mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
echo $$ > /dev/cgroup/cpu/user/$$/tasks
echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi
Patching [/etc/rc.local]...
Adding the patch...
Making backup of /etc/rc.local in /etc/rc.local.backup.txt
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
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
exit 0
Making [/etc/rc.local] executable
Creating [/usr/local/sbin/cgroup_clean]...
#!/bin/sh
if [ "$*" != "/user" ]; then
rmdir /dev/cgroup/cpu/$*
fi
Making [/usr/local/sbin/cgroup_clean] executable
DONE. The patch has been applied. Restart your computer...
$ sudo ./cgroup_patch
Patching [/home/yusuke/.bashrc]...
It seems the patch is already included in /home/yusuke/.bashrc
Patching [/etc/rc.local]...
It seems the patch is already included in /etc/rc.local
Making [/etc/rc.local] executable
Creating [/usr/local/sbin/cgroup_clean]...
File /usr/local/sbin/cgroup_clean already exists.
Making [/usr/local/sbin/cgroup_clean] executable
DONE. The patch has been applied. Restart your computer...
$