#46 init script can miss default group

open
nobody
None
5
2010-03-02
2010-03-02
Chris
No

If there is a directive like *:httpd before * in the cgconfig file, all processes end up being moved into the wrong group on cgconfig startup, and the default group is never made. This fixes it for me:

diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in
index 261c7d8..99608a5 100644
--- a/scripts/init.d/cgconfig.in
+++ b/scripts/init.d/cgconfig.in
@@ -58,7 +58,7 @@ create_default_groups() {
if [ -f /etc/cgrules.conf ]
then
read user ctrl defaultcgroup <<< \ - `grep -m1 ^\* /etc/cgrules.conf`
+ `grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf`
if [[ -n $defaultcgroup && $defaultcgroup = "*" ]]
then
log_warning_msg "/etc/cgrules.conf incorrect"

Discussion

  • Dhaval Giani

    Dhaval Giani - 2010-03-08

    Hi Chris,

    Could you please post this patch to libcg-devel@lists.sourceforge.net. Please note it is a subscribers only list, so you will need to subscribe before posting on that list.

    By posting it on the list, you get wider coverage and quicker response.

    Thanks,
    Dhaval

     
  • Chris

    Chris - 2010-03-09

    Sent it to the list.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks