Mr. Citek,

This script is brillant.  Thank you.  It is brillant not only because you had the knowledge
and ability to write it, but also and especially because you took the time to do and to share it.

Mind if I forward your message to webupd8 ?  (removing e-mail addresses but leaving in your name for
due attribution)

It seems that the main point of contention in regard to this solution is that it is of no benefit
at all for those who only use guis and never open terminals / command lines and that it only
helps those who mix command line activity with gui windows and/or perform multiple command line
tasks.  Would you agree with that assessment or would you say that it might even benefit those gui only
users?

Thanks,

Robert


Robert Citek wrote:
On Fri, Nov 19, 2010 at 10:25 PM, Robert & Janet Bennett
<[email protected]> wrote:
  
If it appears to begin to cause problems after it is applied.  It looks
quite simple to me to remove it again.
    

I'm not a big fan of the "edit this file and add this" instructions.
So here it is in a single cut-n-paste script for those of you running
Ubuntu:

--- start cut here ---

sudo true && (

# create bootup script
{ cat <<eof
#!/bin/bash
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
eof
} | sudo tee -a /etc/init.d/cgroup
sudo chmod +x /etc/init.d/cgroup
sudo ln -snf ../init.d/cgroup /etc/rcS.d/S10cgroup

# create initiate script
{ cat <<"eof"
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
eof
} | sudo tee /etc/profile.d/cgroup.sh

# create cleanup script
{ cat <<"eof"
#!/bin/sh
rmdir /dev/cgroup/cpu/$*
eof
} | sudo tee /usr/local/sbin/cgroup_clean
sudo chmod +x /usr/local/sbin/cgroup_clean

)

--- end cut here ---

You can verify the files were created with these commands:

# Verify
ls -la \
 /etc/rcS.d/S10cgroup \
 /etc/init.d/cgroup \
 /etc/profile.d/cgroup.sh \
 /usr/local/sbin/cgroup_clean

head -1000 \
 /etc/rcS.d/S10cgroup \
 /etc/init.d/cgroup \
 /etc/profile.d/cgroup.sh \
 /usr/local/sbin/cgroup_clean

And if you don't like it, you can remove the files with this command:

# To remove the above scripts and symlinks
sudo rm \
 /etc/rcS.d/S10cgroup \
 /etc/init.d/cgroup \
 /etc/profile.d/cgroup.sh \
 /usr/local/sbin/cgroup_clean


I'm running it on my UNR 10.04 eeePC network.  Don't notice anything
considerably different.

Regards,
- Robert

  

--
Central West End Linux Users Group (via Google Groups)
Main page: http://www.cwelug.org
To post: [email protected]
To subscribe: [email protected]
To unsubscribe: [email protected]
More options: http://groups.google.com/group/cwelug

Reply via email to