[pkg-lxc-devel] Bug#824779: container getty-static.service causes lxcfs high cpu usage
Evgeni Golov
evgeni at debian.org
Mon Jul 18 05:25:01 UTC 2016
Hi Michael,
On Mon, Jul 18, 2016 at 12:17:27AM +0200, Michael Biebl wrote:
> Am 16.07.2016 um 15:34 schrieb Martin Pitt:
> > Control: tag -1 pending
> >
> > Wang Jian [2016-05-19 23:59 +0800]:
> >> getty-static.service starts getty on tty2-6, but container has only 4
> >> ttys (1-4) at default. getty will exit and be respawned for tty5-tty6.
> >> This leads to high cpu usage on host's lxcfs daemon.
> >>
> >
> > There is no point in even wasting four getty processes on tty1-4 in
> > LXC -- containers are not meant to have gettys on ttys in the first
> > place. I committed a fix to git for that.
> > (ConditionVirtualization=!container)
this will break lxc-console, but more later :)
> I just created a test jessie lxc container (using lxc 2.0.0-3~bpo8+1) on
> jessie host system (using lxc-create -t download)
-t debian please, -t download will download an image from
linuxcontainers.org, which might or might not be the same as -t debian.
(AFAIK it is almost identical, but please don't file bugs if it isn't
;))
> The generated chroot had a /etc/systemd/system/getty-static.service
> which was restricted to tty1-tty4 and was overriding the
> getty-static.service shipped by the systemd package.
>
> I assume this file was created by lxc.
> Apparently the lxc maintainers decided it is useful to have a getty on
> tty1-tty4? lxc maintainers, could you give us some input here, why
> getty-static.service was not completely disabled.
My understanding (and that might very well be wrong) is that LXC "wants"
to have ttys with gettys for lxc-console to work. (Even though I never
used it, as lxc-attach is much more convinient).
The code that does the job is here [1] and more exactly here [2].
I don't know the exact history of the code, and Git only says it was
borrowed from the Fedora template [3][4]. I think LXC upstream can
elaborate a bit more here.
Greets
Evgeni
[1] https://github.com/lxc/lxc/blob/master/templates/lxc-debian.in#L208
[2] https://github.com/lxc/lxc/blob/master/templates/lxc-debian.in#L227
[3] https://github.com/lxc/lxc/commit/a9bf60bab547013a9873a3fb9efe61155e8694b8
[4] https://github.com/lxc/lxc/commit/d1240f0335e0c469b850da467661dfbb8f262727
More information about the Pkg-lxc-devel
mailing list