Code: Select all
#!/bin/bash
[ ! -e /etc/rc.d/rc.local ] && exit 0
# apply changes in rc.local
echo '
# speedup
mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
"/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent
' >> /etc/rc.d/rc.local
# make rc.local executable
[ ! -x /etc/rc.d/rc.local ] && chmod +x /etc/rc.d/rc.local
# apply changes in /root/.bashrc
echo '
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
' >> /root/.bashrc
# create /usr/local/sbin/cgroup_clean if needed
echo '
#!/bin/sh
rm -rf /dev/cgroup/cpu/user/$*
' > /usr/local/sbin/cgroup_clean
# make it executable
chmod +x /usr/local/sbin/cgroup_clean
# run it, so its applied immediately
exec /etc/rc.d/rc.local &
REPLY=""
Xdialog --title "Speed up ting" --msgbox "The speed up thing should be installed and running.\n\nDo you want to check?" 0 0
REPLY=$?
[ "$REPLY" = 0 ] && rvxt -e ls /dev/cgroup/cpu/user/ &
exit 0
EDIT: I get the
Code: Select all
mount: unknown filesystem type 'cmount'