LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2019, 06:14 AM   #1
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Rep: Reputation: 36
Unable to run rc.cgconfig


I'm trying to configure /etc/cgconfig.conf like described in Chris Willings' LXC tutorial, but can't get rid of this error:

Code:
# sh /etc/rc.d/rc.cgconfig start
Starting cgconfig service: error at line number 50 at qwerty:syntax error
Error: failed to parse file /etc/cgconfig.conf
/usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Have multiple paths for the same namespace
Failed to parse  /etc/cgconfig.conf
The solution posted in this thread didn't solve for me, as I'm already using the latest patched libcgroup in my Slackware-14.2.
I have LANG=it_IT in my /etc/profile.d/lang.sh.
I also tested the sources of -current with no luck.

I hope someone has an hint how to solve this.

Thanks,
Roberto

Last edited by roberto967; 08-16-2019 at 06:19 AM.
 
Old 08-16-2019, 06:47 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by roberto967 View Post
The solution posted in this thread didn't solve for me, as I'm already using the latest patched libcgroup in my Slackware-14.2.
The 32 bit version is "buggy" as I have stated in the same thread. You must download the the slackbuild and all source files (including the patches) from here and recompile them according to the instructions (i.e., LANG=C ...) in aforementioned thread.

PS: I assume you know how to build and install software in Slackware manually. Post again for directions if this is not the case.

Last edited by crts; 08-16-2019 at 04:30 PM.
 
Old 08-16-2019, 07:06 AM   #3
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post
The 32 bit version is still buggy as I have stated in the same thread. You must download the the slackbuild and all source files (including the patches) from here and recompile them according to the instructions (i.e., LANG=C ...) in aforementioned thread.
This is what I have done, with no luck. Anyway the option LANG=C is already included in the patches/package
 
Old 08-16-2019, 07:20 AM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by roberto967 View Post
Anyway the option LANG=C is already included in the patches/package
Really? I just checked the Slackbuild and did not find that option. What were the exact commands that you issued on the command line? Please post them verbatim.

PS:
Please also post your /etc/cgconfig.conf. I am not sure if you are allowed to have a trailing whitespace or comment on the same line that has instructions on it.

Last edited by crts; 08-16-2019 at 07:33 AM.
 
Old 08-16-2019, 07:30 AM   #5
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post
Really? I just checked the Slackbuild and did not find that option. What were the exact commands that you issued on the command line? Please post them verbatim.
Look at the package inside the "patches" dir here

This is like running the slackbuild like this

Code:
LANG=C ./libcgroup.SlackBuild
 
Old 08-16-2019, 08:08 AM   #6
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post
PS:
Please also post your /etc/cgconfig.conf. I am not sure if you are allowed to have a trailing whitespace or comment on the same line that has instructions on it.
here it is (I'm just testing Chris Willings' guide):

Code:
#
#  Copyright IBM Corporation. 2007
#
#  Authors:     Balbir Singh <balbir@linux.vnet.ibm.com>
#  This program is free software; you can redistribute it and/or modify it
#  under the terms of version 2.1 of the GNU Lesser General Public License
#  as published by the Free Software Foundation.
#
#  This program is distributed in the hope that it would be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#group daemons/www {
#       perm {
#               task {
#                       uid = root;
#                       gid = webmaster;
#               }
#               admin {
#                       uid = root;
#                       gid = root;
#               }
#       }
#       cpu {
#               cpu.shares = 1000;
#       }
#}
#
#group daemons/ftp {
#       perm {
#               task {
#                       uid = root;
#                       gid = ftpmaster;
#               }
#               admin {
#                       uid = root;
#                       gid = root;
#               }
#       }
#       cpu {
#               cpu.shares = 500;
#       }
#}
#
#mount {
#       cpu = /mnt/cgroups/cpu;
#       cpuacct = /mnt/cgroups/cpuacct;
#}

group qwerty { 
    perm {
        task {
            uid = chris;
            gid = users;
        }
    admin {
          uid = chris;
          gid = users;
      }
  }

  cpuset {
      cgroup.clone_children = 1;
      cpuset.mems = 0;
      cpuset.cpus = 0-3;
  }
  cpu {}
  cpuacct {}
  blkio {}
  memory { memory.use_hierarchy = 1; }
  devices {}
  freezer {}
  net_cls {}
  perf_event {}
  net_prio {}
  pids {}
}
I get the same error even when using the commented example

Last edited by roberto967; 08-16-2019 at 08:09 AM.
 
Old 08-16-2019, 08:38 AM   #7
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Alright, you will really have to humour me on this one because I am seeing some odd behaviour on my 32bit machine (64bit works fine).
Uninstall the prebuilt version from the Slackware repository:
Code:
removepkg libcgroup
Now download all the Slackbuild source files from the repo you linked earlier:
https://mirrors.slackware.com/slackw...rce/libcgroup/

Now 'cd' into the Slackbuild folder, make the Slackbuild executable and issue:
Code:
./libcgroup.Slackbuild
Install your freshly built version.
Code:
installpkg /tmp/libcgroup-0.41-i586-5_slack14.2.txz
You may have to restart your machine first, at least I have to. Does it work now?
That is the only way I can make it work. The prebuilt version from the repo still exhibits the same behaviour as mentioned above.
 
Old 08-16-2019, 08:50 AM   #8
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post
[...]
You may have to restart your machine first, at least I have to. Does it work now?
That is the only way I can make it work. The prebuilt version from the repo still exhibits the same behaviour as mentioned above.
No, it didn't
And I have removed the package before running the slackbuild and rebooted as you suggested... this is verrry strange...
 
Old 08-16-2019, 09:03 AM   #9
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hm, is it still the same error or is it different? What is the exact output? How are you starting the service? Until the issue is resolved you should the remove the executable bits from all involved rc.* scripts so the errors do not just scroll by during boot. Please post every command you have issued and its output until it errors.

On a sidenote:
Code:
...
  cpuset {
      cgroup.clone_children = 1;
      cpuset.mems = 0;
      cpuset.cpus = 0-3;
  }
...
Are you really using a 32bit machine with four cpu-cores? This looks like copy+pasted from the article. You might have to adjust the value according to the actual number of cpus/cores in your machine.
 
Old 08-16-2019, 09:22 AM   #10
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post
Hm, is it still the same error or is it different? What is the exact output? How are you starting the service?
It is the same error:

Code:
# sh rc.cgconfig start
Starting cgconfig service: error at line number 50 at qwerty:syntax error
Error: failed to parse file /etc/cgconfig.conf
/usr/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Have multiple paths for the same namespace
Failed to parse  /etc/cgconfig.conf
Quote:
Originally Posted by crts View Post
Until the issue is resolved you should the remove the executable bits from all involved rc.* scripts so the errors do not just scroll by during boot.
The +x flag was already off

Quote:
Originally Posted by crts View Post
Please post every command you have issued and its output until it errors.
Trying one of these produces the error above

Code:
sh rc.cgconfig start

cgconfigparser -l /etc/cgconfig.conf
I suppose that the last one is the command which throws into error rc.config

Quote:
Originally Posted by crts View Post
On a sidenote:
Code:
...
  cpuset {
      cgroup.clone_children = 1;
      cpuset.mems = 0;
      cpuset.cpus = 0-3;
  }
...
Are you really using a 32bit machine with four cpu-cores? This looks like copy+pasted from the article. You might have to adjust the value according to the actual number of cpus/cores in your machine.
Yes, you're right, it was a cut&paste. Now I adjusted like this cpuset.cpus = 0-1; and also tried to comment that line but the error is still there. As said I tested the commented example as well...

Last edited by roberto967; 08-16-2019 at 04:45 PM.
 
Old 08-16-2019, 11:02 AM   #11
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Well, I am out of ideas. When I try to parse your sample I get an error for another line:

Code:
/usr/sbin/cgconfigparser -l ./cgconfig.conf
parsing failed at line number 53
Error: failed to parse file ./orgcgconfig.conf
/usr/sbin/cgconfigparser; error loading ./orgcgconfig.conf: Have multiple paths for the same namespace
This is because I do not have a user 'chris' on my system. After replacing the line with a user that exists on my system the error goes away.

The only other reasons I know is if a line has a trailing comment, e.g.,
Code:
group somegroupname { # comment
then it will fail with the same error. Finally - this is rather unlikely - if you have DOS style newlines. This would only be the case if you created the file under Windows and are now trying to work with it under Linux.
Code:
od -a /etc/cgconfig.conf
would reveal something like that.
 
Old 08-16-2019, 03:57 PM   #12
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
I created the user chris, also the group qwerty (never knows at this point), but the error was again at the first not commented line

Code:
Starting cgconfig service: error at line number 50 at qwerty:syntax error
Quote:
Originally Posted by crts View Post
[...]
Finally - this is rather unlikely - if you have DOS style newlines. This would only be the case if you created the file under Windows and are now trying to work with it under Linux.
Code:
od -a /etc/cgconfig.conf
would reveal something like that.
No windows at all, I did a cut&paste from chris' web page on my nano editor. Anyway this is what I see at the end, I suppose it's fine:

Code:
# od -a /etc/cgconfig.conf

[..............]
0001600   t   ;  nl   #   }  nl  nl   g   r   o   u   p  sp   q   w   e
0001620   r   t   y  sp   {  nl  sp  sp  sp  sp   p   e   r   m  sp   {
0001640  nl  sp  sp  sp  sp  sp  sp  sp  sp   t   a   s   k  sp   {  nl
0001660  sp  sp  sp  sp  sp  sp  sp  sp  sp  sp  sp  sp   u   i   d  sp
0001700   =  sp   r   o   b   e   r   t   o   ;  nl  sp  sp  sp  sp  sp
0001720  sp  sp  sp  sp  sp  sp  sp   g   i   d  sp   =  sp   u   s   e
0001740   r   s   ;  nl  sp  sp  sp  sp  sp  sp  sp  sp   }  nl  sp  sp
0001760  sp  sp   a   d   m   i   n  sp   {  nl  sp  sp  sp  sp  sp  sp
0002000  sp  sp  sp  sp   u   i   d  sp   =  sp   r   o   b   e   r   t
0002020   o   ;  nl  sp  sp  sp  sp  sp  sp  sp  sp  sp  sp   g   i   d
0002040  sp   =  sp   u   s   e   r   s   ;  nl  sp  sp  sp  sp  sp  sp
0002060   }  nl  sp  sp   }  nl   }  nl
0002070
 
Old 08-16-2019, 04:38 PM   #13
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
The output from 'od' looks OK.

You could try to change you LANG setting to something like
Code:
export LANG=en_US.UTF-8
but we are grasping at straws here, it will probably not help.
Another thing I noticed is that your profile says you are using Slackware64 but in your initial you state just Slackware-14.2 which is the 32-bit version. Note, that I only encountered this problem on my 32-bit machine, never had this problem on the 64-bit machines.
Does LXC with unprivileged users work on a 64-bit installation?
 
Old 08-17-2019, 04:28 AM   #14
roberto967
Member
 
Registered: Apr 2011
Location: Cagliari, Italy
Distribution: Slackware64-15.0 multilib
Posts: 117

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by crts View Post

You could try to change you LANG setting to something like
Code:
export LANG=en_US.UTF-8
it didn't help

Quote:
Originally Posted by crts View Post
Another thing I noticed is that your profile says you are using Slackware64 but in your initial you state just Slackware-14.2 which is the 32-bit version. Note, that I only encountered this problem on my 32-bit machine, never had this problem on the 64-bit machines.
Does LXC with unprivileged users work on a 64-bit installation?
My profile refers to the computer I have at home, now I'm away playing with a 32b.
Anyway I connected to my 64b server and it works fine there (didn't test LXC yet).

[OT]
I'm a little scared doing tests with LXC containers there, as the server already has containers based on Linux-vserver and I would like to ask if LXC and Linux-vserver containers can cohexist as long as I do the migration to LXC one day.

Last edited by roberto967; 08-17-2019 at 07:32 AM.
 
Old 08-17-2019, 07:28 AM   #15
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
I have not experimented with any other containers than LXC, so I cannot say if they will play nice with Linux-vserver.
It is a bit hard to guess what is going on if I cannot reproduce the error. I assume that your 32-bit machine is fully updated, except for libcgroup. You have been using the one that you compiled yourself, right? You could try compiling all versions from the repository starting with the first version
Code:
libcgroup-0.41-i586-1_slack14.2
and work your way up to
Code:
libcgroup-0.41-i586-5_slack14.2
Compile all of them by explicitly passing
Code:
LANG=C ./libcgroup.Slackbuild
I does not matter if LANG=C is also defined in the Slackbuild.

If that does not help then try building the configuration file from scratch. Start with an empty file, no comments, just
Code:
touch scratch.conf
/usr/sbin/cgconfigparser -l ./scratch.conf
Then try manually building up the file, keep it all in one line
Code:
group qwerty { cpu {} }
or try stretching it over several lines
Code:
group qwerty {
    cpu {}
}
But again we are reaching for straws here. Sorry I cannot be of more help.

Last edited by crts; 08-17-2019 at 07:31 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cgroups in rc.S and in rc.cgconfig Lockywolf Slackware 10 06-13-2019 12:40 AM
[SOLVED] Can't run a bash script at startup to run xset-unable to open display thorkelljarl Linux - Software 12 10-20-2018 01:14 PM
[SOLVED] cgconfig failed sindh Linux - Newbie 1 10-27-2014 01:17 AM
Unable to run another command from within shell script, when run from home directory blackray1 Linux - Newbie 7 07-01-2013 09:42 AM
Volume control is unable to run correctly. Unable to open audio device '/dev/mixer'. sevenreams Slackware 1 05-16-2003 07:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration