Started containers create zombies processes

Hi, I already faced that, but I can’t remember how I’ve resolved it. On a fresh Ubuntu 18.04 install I’ve only setup LXD, with 2 containers. When they are started I’ve got zombies processes, who disappears when I stop the containers.

For more context :

  • Storage : LVM
  • Containers’s image : Linux Alpine 3.7
  • paste of ps

When I look for zombie processes from inside the containers, I can’t find them.

I think those are additional consoles that fail to start under LXD.
The solution would be for the image to be made to respect the container’s pid1 environment which describes the list of consoles that are ready for use.

It’s something we may try to improve when we transition our Alpine images over to distrobuilder.

1 Like

So, except not using Alpine Linux, in the meanwhile there isn’t any good way to solve it on my side I guess.

I know theses aren’t a big issues, but it’s annoying.

Thanks for the answer !

Should be reasonably easy to turn off those consoles in your container’s configuration.
I don’t really know Alpine, but it may be something like inittab or the like in your container’s /etc

There’s also:

lxc config set <container-name> raw.lxc "lxc.tty.max = 0"

Ah, or if that doesn’t get rid of it:

lxc config set <container-name> raw.lxc "lxc.tty.max = 4"

which will have LXC setup four ttys. :slight_smile:

We’ve actually switched the Alpine images over to distrobuilder last week, newly created containers should no longer have those respawning getty processes.

Hi:

On a related mater. After I SSH into myUbuntu 20.04 servers, I “often” get greeted with:

=> There are 2 zombie processes

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 193006 0.0 0.0 0 0 ? Z Jan27 0:00 [lxd]
root 193445 0.0 0.0 0 0 ? Z Jan27 0:00 [lxd]

These are ‘persistent’ in that if I kill them, they frequently re-appear after a reboot.

It doesn’t seem to cause any operational problem with any of my containers, I just want to report it FYI. If this is worthy of your time, I’ll be happy to provide additional information, but you may have to be reasonably specific as an expert at the command line I am not.

V/R

Andrew

Do you use the proxy device in LXD?

In the containers I run various web services like haproxy, apache2, samba and things like that, and I share disks with various containers and such, but nothing that used to create zombie processes in the past in older versions of LXD (and now on 4.10). If you can be more specific I will try to answer.

Please show lxc config show <instance> --expanded?

This is for THREE containers (Nextcloud, haproxy and samba - probably self explanatory?):

(my guess would be haproxy (the first one below), since I have more than one instance of this and it runs on different machines - and “The Zombies” are occuring on these different machines?)

architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20200625)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: “20200625”
image.type: squashfs
image.version: “20.04”
volatile.base_image: aa623d1c9562bd954dc4c685a54eacac3e0ceacf7a05a7308de0d1aed3a8996a
volatile.eth0.host_name: veth0d348506
volatile.eth0.hwaddr: 00:16:3e:68:1d:a3
volatile.idmap.base: “0”
volatile.idmap.current: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.power: RUNNING
volatile.uuid: 184f475c-bfda-48b0-bb1d-f6ab46436689
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
myport80:
connect: tcp:127.0.0.1:80
listen: tcp:0.0.0.0:80
type: proxy
myport443:
connect: tcp:127.0.0.1:443
listen: tcp:0.0.0.0:443
type: proxy
root:
path: /
pool: default
type: disk
ephemeral: false
profiles:

  • default
    stateful: false
    description: “”

architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20210114)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: “20210114”
image.type: squashfs
image.version: “20.04”
raw.idmap: both 1000 1000
volatile.base_image: 163ae280f81055cf09d250f2f04717609a61a61fbba5101711cb825f58948e55
volatile.eth0.host_name: veth1d66d8a8
volatile.eth0.hwaddr: 00:16:3e:eb:5b:c3
volatile.idmap.base: “0”
volatile.idmap.current: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.last_state.power: RUNNING
volatile.uuid: f195a90b-b5a1-4ee6-b472-e34eae7bc54b
devices:
DiskName:
path: /var/www/nextcloud-data
source: /mnt/nextcloud-data-2TBSSD/
type: disk
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: SSD-Pool
type: disk
ephemeral: false
profiles:

  • default
  • mapping
    stateful: false
    description: “”

architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 20.04 LTS amd64 (release) (20210119.1)
image.label: release
image.os: ubuntu
image.release: focal
image.serial: “20210119.1”
image.type: squashfs
image.version: “20.04”
raw.idmap: both 1000 1000
volatile.base_image: 690801402e1d4e02c07ba2d1a29bb9a9b4825f037c12ccad8cb4d062d2450d2c
volatile.eth0.host_name: mac2bcb38e4
volatile.eth0.hwaddr: 00:16:3e:43:6d:6a
volatile.eth0.last_state.created: “false”
volatile.eth0.name: eth0
volatile.idmap.base: “0”
volatile.idmap.current: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:true,“Isgid”:false,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000},{“Isuid”:true,“Isgid”:true,“Hostid”:1000,“Nsid”:1000,“Maprange”:1},{“Isuid”:false,“Isgid”:true,“Hostid”:1001001,“Nsid”:1001,“Maprange”:999998999}]’
volatile.last_state.power: RUNNING
volatile.uuid: c2ac4d49-e535-4796-8248-eceb8e20bdd0
devices:
SSD-nas-drive:
path: /samba/kazand
source: /mnt/nas
type: disk
eth0:
nictype: macvlan
parent: enp3s0f1
type: nic
root:
path: /
pool: SSD-Pool
type: disk
ephemeral: false
profiles:

  • default
  • macvlan
  • mapping
    stateful: false
    description: “”

Yes so you are using a proxy device in your config, in which case you’re likely affected by:

2 Likes

Ah, thank you. I spent a lot of time wondering if I had screwed this up since it appeared on more than one machine. The good news for me was that it seems harmless.

Thank you very much for taking the time to inform me better. Have a good weekend. :slight_smile:

1 Like