Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-04-2013, 05:38 AM
|
#1
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
|
Slackware64 14.1 control groups filesystem mount problem
In /etc/rc.d/rc.S, there's some code that attempts to autodetect and mount the control groups filesystem interface...
Code:
# Mount Control Groups filesystem interface:
if grep -wq cgroup /proc/filesystems ; then
if [ -d /sys/fs/cgroup ]; then
# See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
# Check if we have some tools to autodetect the available cgroup controllers
if [ -x /usr/bin/lssubsys -a -x /usr/bin/tr -a -x /usr/bin/sed ]; then
# Mount a tmpfs as the cgroup filesystem root
mount -t tmpfs -o mode=0755 cgroup_root /sys/fs/cgroup
# Autodetect available controllers and mount them in subfolders
controllers="$(lssubsys -a 2>/dev/null | tr '\n' ' ' | tr ',' ' ' | sed s/.$//)"
for i in $controllers; do
mkdir /sys/fs/cgroup/$i
mount -t cgroup -o $i $i /sys/fs/cgroup/$i
done
unset i controllers
else
# We can't use autodetection so fall back mounting them all together
mount -t cgroup cgroup /sys/fs/cgroup
fi
else
mkdir -p /dev/cgroup
mount -t cgroup cgroup /dev/cgroup
fi
fi
The autodetection works just fine, as long as you don't have /usr on a separate partition. Sadly, I do have /usr in its own logical volume, so I get the fallback. The fallback, however, doesn't work for the current version of libvirt.
The following version of the above code appears to work with no issues on my setup and allows libvirt to function (changes in bold):
Code:
# Mount Control Groups filesystem interface:
if grep -wq cgroup /proc/filesystems ; then
if [ -d /sys/fs/cgroup ]; then
# See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
# Check if we have some tools to autodetect the available cgroup controllers
if [ -x /bin/cut -a -x /bin/tail ]; then
# Mount a tmpfs as the cgroup filesystem root
mount -t tmpfs -o mode=0755 cgroup_root /sys/fs/cgroup
# Autodetect available controllers and mount them in subfolders
controllers="$(cat /proc/cgroups | cut -f 1 | tail -n +2)"
for i in $controllers; do
mkdir /sys/fs/cgroup/$i
mount -t cgroup -o $i $i /sys/fs/cgroup/$i
done
unset i controllers
else
# We can't use autodetection so fall back mounting them all together
mount -t cgroup cgroup /sys/fs/cgroup
fi
else
mkdir -p /dev/cgroup
mount -t cgroup cgroup /dev/cgroup
fi
fi
I assume this is so early in the boot process so that LVM and/or fuse could be controlled by a control group. I don't know the ramifications to moving the original block of code quoted above to after the filesystems are mounted.
|
|
|
12-04-2013, 05:48 AM
|
#2
|
LQ Guru
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,505
|
I proposed that block to Pat as I'm a libvirt user too: from a rapid test yours seems to work fine as well 
|
|
|
12-04-2013, 09:56 AM
|
#3
|
LQ Veteran
Registered: May 2008
Posts: 7,148
|
From what I understand of the topic I believe the cgroup filesystems are there as a control interface. I doubt anything in lvm or fuse would need to use them, so I wouldn't expect problems from moving that section to a little later in rc.S.
Oh, and UUOC!  Shame on you!
controllers="$(cut -f 1 /proc/cgroups | tail -n +2)"
|
|
|
12-04-2013, 01:02 PM
|
#4
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
Original Poster
|
Quote:
Originally Posted by GazL
Oh, and UUOC!  Shame on you!
controllers="$(cut -f 1 /proc/cgroups | tail -n +2)"
|
Oops
BTW, the "original" version that I have above is actually modified from stock, which is
Code:
controllers="$(lssubsys -a 2>/dev/null | tr '\n' ' ' | sed s/.$//)"
Unfortunately, lssubsys -a provides the subsystem list in a comma delimited form...
Code:
root@testbed:~# lssubsys -a
cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event
root@testbed:~#lssubsys -a 2>/dev/null | tr '\n' ' ' | sed s/.$//
cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event
..which won't work in the for loop anyways. So there's actually a bug in the original, unless the init scripts change IFS to include ",".
|
|
1 members found this post helpful.
|
02-20-2014, 10:39 PM
|
#5
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
Original Poster
|
Integrating GazL's spanking  to my change with the stuff that's changed from the stock /etc/rc.d/rc.S code in bold...
Code:
# Mount Control Groups filesystem interface:
if grep -wq cgroup /proc/filesystems ; then
if [ -d /sys/fs/cgroup ]; then
# See linux-*/Documentation/cgroups/cgroups.txt (section 1.6)
# Check if we have some tools to autodetect the available cgroup controllers
if [ -x /bin/cut -a -x /bin/tail ]; then
# Mount a tmpfs as the cgroup filesystem root
mount -t tmpfs -o mode=0755 cgroup_root /sys/fs/cgroup
# Autodetect available controllers and mount them in subfolders
controllers="$(cut -f 1 /proc/cgroups | tail -n +2)"
for i in $controllers; do
mkdir /sys/fs/cgroup/$i
mount -t cgroup -o $i $i /sys/fs/cgroup/$i
done
unset i controllers
else
# We can't use autodetection so fall back mounting them all together
mount -t cgroup cgroup /sys/fs/cgroup
fi
else
mkdir -p /dev/cgroup
mount -t cgroup cgroup /dev/cgroup
fi
fi
...to make it easier to align your systems (if needed) to the above code.
|
|
|
02-20-2014, 10:56 PM
|
#6
|
Senior Member
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,860
Original Poster
|
Quote:
Originally Posted by Richard Cranium
Unfortunately, lssubsys -a provides the subsystem list in a comma delimited form...
Code:
root@testbed:~# lssubsys -a
cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event
root@testbed:~#lssubsys -a 2>/dev/null | tr '\n' ' ' | sed s/.$//
cpuset,cpu,cpuacct,devices,freezer,net_cls,blkio,perf_event
..which won't work in the for loop anyways. So there's actually a bug in the original, unless the init scripts change IFS to include ",".
|
Interestingly, my upgraded-from-14.0-to-14.1 system does not have a problem with the lssubsys -a providing output in comma delimited form (the command provides it in space delimited form) but both of my installed-brand-spanking-new-14.1-install systems do (the output is comma delimited on those systems)!
|
|
|
All times are GMT -5. The time now is 08:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|