Can no longer access /sys/fs/cgroup after "ip netns exec foo"

Asked by Sam H

Using:
 16.04.2 LTS (Xenial Xerus)
  ip utility, iproute2-ss151103

I am able to access cgroup files under /sys/fs/cgroup just fine as root in the default network namespace
root@ub:~# ls -al /sys/fs/cgroup
total 0
drwxr-xr-x 14 root root 360 Jul 14 02:20 .
drwxr-xr-x 8 root root 0 Oct 7 14:32 ..
dr-xr-xr-x 2 root root 0 Jul 14 02:20 blkio
drwxr-xr-x 2 root root 60 Jul 14 02:20 cgmanager
lrwxrwxrwx 1 root root 11 Jul 14 02:20 cpu -> cpu,cpuacct
lrwxrwxrwx 1 root root 11 Jul 14 02:20 cpuacct -> cpu,cpuacct
dr-xr-xr-x 2 root root 0 Jul 14 02:20 cpu,cpuacct
dr-xr-xr-x 2 root root 0 Jul 14 02:20 cpuset
dr-xr-xr-x 5 root root 0 Jul 14 02:20 devices
dr-xr-xr-x 2 root root 0 Jul 14 02:20 freezer
dr-xr-xr-x 2 root root 0 Jul 14 02:20 hugetlb
dr-xr-xr-x 2 root root 0 Jul 14 02:20 memory
lrwxrwxrwx 1 root root 16 Jul 14 02:20 net_cls -> net_cls,net_prio
dr-xr-xr-x 2 root root 0 Jul 14 02:20 net_cls,net_prio
lrwxrwxrwx 1 root root 16 Jul 14 02:20 net_prio -> net_cls,net_prio
dr-xr-xr-x 2 root root 0 Jul 14 02:20 perf_event
dr-xr-xr-x 5 root root 0 Jul 14 02:20 pids
dr-xr-xr-x 5 root root 0 Jul 14 02:20 systemd

When I start up a bash session in a different network namespace, I'm no longer able to access cgroup files.
root@ub:~# ip netns exec foo bash
root@ub:~# ls -al /sys/fs/cgroup
total 0
dr-xr-xr-x 2 root root 0 Oct 9 04:55 .
drwxr-xr-x 8 root root 0 Oct 7 14:32 ..

I would like to be able to access the cgroup control files from a bash session that is using a different network namespace. I've seen articles indicating that the is a conflict in how iproute2 mounts /sys and the system having cgroups mounted at /sys/fs/cgroup and some utilities being hardcoded to expect cgroups at /sys/fs/cgroup.

Is there an alternate version of iproute2 that will preserve the cgroup mount or some other suggestion?

I tried updating iproute2, but I seem to be at the latest:
  root@ub:~# apt-get upgrade iproute2
  iproute2 is already the newest version (4.3.0-1ubuntu3.16.04.1).

 Thanks,
-- Sam

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu iproute2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.