Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Jean-Michel Vourgère-2
Package: lxc
Version: 1:2.0.7-2
Severity: normal

Dear Maintainer,

When trying to start a container, I get these errors:
# lxc-start -n test -F
lxc-start: cgroups/cgfs.c: lxc_cgroupfs_create: 901 Could not find writable
mount point for cgroup hierarchy 11 while trying to create cgroup.
lxc-start: cgroups/cgfs.c: cgroup_rmdir: 209 Device or resource busy -
cgroup_rmdir: failed to delete
/sys/fs/cgroup/systemd//user.slice/user-0.slice/session-1.scope
lxc-start: cgroups/cgfs.c: cgroup_rmdir: 209 Device or resource busy -
cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//user.slice/user-0.slice
lxc-start: cgroups/cgfs.c: cgroup_rmdir: 209 Device or resource busy -
cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//user.slice
lxc-start: cgroups/cgfs.c: cgroup_rmdir: 209 Device or resource busy -
cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd/
lxc-start: start.c: lxc_spawn: 1108 Failed creating cgroups.
lxc-start: start.c: __lxc_start: 1346 Failed to spawn container "test".
lxc-start: tools/lxc_start.c: main: 366 The container failed to start.
lxc-start: tools/lxc_start.c: main: 370 Additional information can be obtained
by setting the --logfile and --logpriority options.

If I enable systemd, lxc starts working. But then I have issues with other
software, so I don't want to do that.

Attached are my mounts, since I have the feeling this is related.

Do I need some special systemd related cgroups for lxc, now?

A few pointers in the documentation would be nice. :)

-- System Information:
Debian Release: 9.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages lxc depends on:
ii  init-system-helpers  1.48
ii  libapparmor1         2.11.0-3
ii  libc6                2.24-11+deb9u1
ii  libcap2              1:2.25-1
ii  libgnutls30          3.5.8-5+deb9u2
ii  liblxc1              1:2.0.7-2
ii  libseccomp2          2.3.1-2.1
ii  libselinux1          2.6-3+b1
ii  lsb-base             9.20161125
ii  python3              3.5.3-1
ii  python3-lxc          1:2.0.7-2

Versions of packages lxc recommends:
ii  bridge-utils  1.5-13
ii  debootstrap   1.0.89
ii  dirmngr       2.1.18-6
ii  dnsmasq-base  2.76-5+b1
ii  gnupg         2.1.18-6
ii  iptables      1.6.0+snapshot20161117-6
ii  libpam-cgfs   2.0.7-1
ii  lxcfs         2.0.7-1
ii  openssl       1.1.0f-3
ii  rsync         3.1.2-1
ii  uidmap        1:4.4-4.1

Versions of packages lxc suggests:
pn  apparmor     <none>
pn  btrfs-tools  <none>
ii  lvm2         2.02.168-2

-- no debconf information

      lxc-start 20170727110253.578 ERROR    lxc_cgfs - cgroups/cgfs.c:lxc_cgroupfs_create:901 - Could not find writable mount point for cgroup hierarchy 11 while trying to create cgroup.
      lxc-start 20170727110253.578 ERROR    lxc_cgfs - cgroups/cgfs.c:cgroup_rmdir:209 - Device or resource busy - cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//user.slice/user-0.slice/session-5.scope
      lxc-start 20170727110253.578 ERROR    lxc_cgfs - cgroups/cgfs.c:cgroup_rmdir:209 - Device or resource busy - cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//user.slice/user-0.slice
      lxc-start 20170727110253.578 ERROR    lxc_cgfs - cgroups/cgfs.c:cgroup_rmdir:209 - Device or resource busy - cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd//user.slice
      lxc-start 20170727110253.578 ERROR    lxc_cgfs - cgroups/cgfs.c:cgroup_rmdir:209 - Device or resource busy - cgroup_rmdir: failed to delete /sys/fs/cgroup/systemd/
      lxc-start 20170727110253.578 ERROR    lxc_start - start.c:lxc_spawn:1108 - Failed creating cgroups.
      lxc-start 20170727110253.578 ERROR    lxc_start - start.c:__lxc_start:1346 - Failed to spawn container "test".
      lxc-start 20170727110259.895 ERROR    lxc_start_ui - tools/lxc_start.c:main:366 - The container failed to start.
      lxc-start 20170727110259.896 ERROR    lxc_start_ui - tools/lxc_start.c:main:368 - To get more details, run the container in foreground mode.
      lxc-start 20170727110259.897 ERROR    lxc_start_ui - tools/lxc_start.c:main:370 - Additional information can be obtained by setting the --logfile and --logpriority options.
Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Jean-Michel Vourgère-2
I finally had it working by adding
"cgroup  /sys/fs/cgroup  cgroup  defaults  0   0"
to my /etc/fstab

A little note in /usr/share/doc or elsewhere would be nice.

Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Evgeni Golov-2
Hi,

On Thu, Jul 27, 2017 at 01:03:51PM +0000, Jean-Michel Vourgère wrote:
> I finally had it working by adding
> "cgroup  /sys/fs/cgroup  cgroup  defaults  0   0"
> to my /etc/fstab
>
> A little note in /usr/share/doc or elsewhere would be nice.

This is why liblxc1 has a "Depends: cgroupfs-mount | systemd", as
cgroupfs-mount should be used to mount cgroupfs on non-systemd systems.
(I say should, as it is perfectly fine to do it otherwise, just
cgroupfs-mount is what we have tested).

I guess in your case the systemd binary is installed (but not used as
init) and thus the dependency did not trigger?

Evgeni

Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Jean-Michel Vourgère-2
In reply to this post by Jean-Michel Vourgère-2
> > I finally had it working by adding

> > "cgroup  /sys/fs/cgroup  cgroup  defaults  0   0"
> > to my /etc/fstab
> >
> > A little note in /usr/share/doc or elsewhere would be nice.
>
> This is why liblxc1 has a "Depends: cgroupfs-mount | systemd", as
> cgroupfs-mount should be used to mount cgroupfs on non-systemd systems.
> (I say should, as it is perfectly fine to do it otherwise, just
> cgroupfs-mount is what we have tested).
>
> I guess in your case the systemd binary is installed (but not used as
> init) and thus the dependency did not trigger?
Exactly. cgroupfs-mount was not installed and installing it fixed my issue.

Maybe the dependency could be adjusted?
What about
        Depends: cgroupfs-mount | systemd-sysv
?

When you install sysvinit-core, systemd-sysv gets removed. And vice-versa.

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Evgeni Golov-2
Hi,

On Fri, Oct 20, 2017 at 03:09:34PM +0200, Jean-Michel Vourgère wrote:

> > I guess in your case the systemd binary is installed (but not used as
> > init) and thus the dependency did not trigger?
>
> Exactly. cgroupfs-mount was not installed and installing it fixed my issue.
>
> Maybe the dependency could be adjusted?
> What about
> Depends: cgroupfs-mount | systemd-sysv
> ?
>
> When you install sysvinit-core, systemd-sysv gets removed. And vice-versa.

my understanding (and I might be wrong) is that one should not use
sysvinit-core and systemd-sysv in Depends, but their sysvinit and
systemd as these are enough to use them as init (by calling
init=/lib/whatver).

on the other hand, cgroupfs-mount is a noop when systemd is init, so we
could just depend on it, uncoditionally. what do you think?

Evgeni

Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Jean-Michel Vourgère-2
On Saturday, 21 October 2017 17:08:42 CEST Evgeni Golov wrote:

> Hi,
>
> On Fri, Oct 20, 2017 at 03:09:34PM +0200, Jean-Michel Vourgère wrote:
> > > I guess in your case the systemd binary is installed (but not used as
> > > init) and thus the dependency did not trigger?
> >
> > Exactly. cgroupfs-mount was not installed and installing it fixed my
> > issue.
> >
> > Maybe the dependency could be adjusted?
> > What about
> >
> > Depends: cgroupfs-mount | systemd-sysv
> >
> > ?
> >
> > When you install sysvinit-core, systemd-sysv gets removed. And vice-versa.
>
> my understanding (and I might be wrong) is that one should not use
> sysvinit-core and systemd-sysv in Depends, but their sysvinit and
> systemd as these are enough to use them as init (by calling
> init=/lib/whatver).
>
> on the other hand, cgroupfs-mount is a noop when systemd is init, so we
> could just depend on it, uncoditionally. what do you think?
That works for me.

In my opinion, both init systems should provide a system in the same state.
The issue is womewhat larger than lxc, and we should probably ask outside for
a proper fix. But I fear there still is a lot of stress around, with the new
default init system, and I am tired just thinking about geting into that topic
again... :(

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#869892: Using sysv, lxc-start fails while trying to create cgroup

Antonio Terceiro-3
On Sun, Oct 22, 2017 at 06:34:14PM +0200, Jean-Michel Vourgère wrote:

> On Saturday, 21 October 2017 17:08:42 CEST Evgeni Golov wrote:
> > Hi,
> >
> > On Fri, Oct 20, 2017 at 03:09:34PM +0200, Jean-Michel Vourgère wrote:
> > > > I guess in your case the systemd binary is installed (but not used as
> > > > init) and thus the dependency did not trigger?
> > >
> > > Exactly. cgroupfs-mount was not installed and installing it fixed my
> > > issue.
> > >
> > > Maybe the dependency could be adjusted?
> > > What about
> > >
> > > Depends: cgroupfs-mount | systemd-sysv
> > >
> > > ?
> > >
> > > When you install sysvinit-core, systemd-sysv gets removed. And vice-versa.
> >
> > my understanding (and I might be wrong) is that one should not use
> > sysvinit-core and systemd-sysv in Depends, but their sysvinit and
> > systemd as these are enough to use them as init (by calling
> > init=/lib/whatver).
> >
> > on the other hand, cgroupfs-mount is a noop when systemd is init, so we
> > could just depend on it, uncoditionally. what do you think?
>
> That works for me.
>
> In my opinion, both init systems should provide a system in the same state.
> The issue is womewhat larger than lxc, and we should probably ask outside for
> a proper fix.
Well, this is in principle true but very few packages really care
specifically about cgroups, so in this case making lxc depend on
cgroupfs-mount uncoditionally works for me.

signature.asc (849 bytes) Download Attachment