On 08/19/2011 10:24 PM, Ryan Lovett wrote: > Hello, > > I'm testing cgroups on an Ubuntu 10.04 machine and have run into some > difficulty trying to contain a named process. In /etc/cgrules.conf I have > > user1:emacs memory user1/emacs/ > user2 memory user2/ > > and in /etc/cgconfig.conf I have > > mount { > cpu = /mnt/cgroups/cpu; > cpuacct = /mnt/cgroups/cpuacct; > memory = /mnt/cgroups/memory; > } > group user1/emacs { > perm { > task { > uid = user1; > } > admin { > uid = root; > } > } > memory { > memory.limit_in_bytes = 10485760; > } > } > group user2 { > perm { > admin { > uid = root; > } > task { > uid = root; > } > } > memory { > memory.limit_in_bytes = 1048576; > } > } > > If I run "cgexec -g memory:user1/emacs emacs" as user user1, the process > process shows up in /mnt/cgroups/memory/user1/emacs/tasks. If I just run > emacs as user1, the process does not show up there. If user1/emacs task > uid is set to root, I cannot successfully cgexec. > > cgrulesengd is running and I also have the cgroup PAM module loaded via > the common-session stack. All of user2's jobs show up in > /mnt/cgroups/memory/user2/tasks without requiring cgexec. > > Any advice on how to configure named processes would be greatly > appreciated.
On Fedora, /usr/bin/emacs is just a symbolic link to /etc/alternatives/emacs, which is again link to /usr/bin/emacs-23.2. I suppose Ubuntu has similar setup. These links confuse cgrulesengd so it is not able to find name of the executable and therefore move emacs processes to the right group. Try to use emacs-23.2 in cgrules.conf and run /usr/bin/emacs-23.2 (or real name of the executable in Ubuntu) instead of pure emacs - does it help? I'll try to find a proper solution in the meantime. Jan ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel