How are (gentoo) images made? How can I make my own?

Hi @monstermunchkin!

I would like to improve the project’s gentoo images or make my own, as they don’t behave.

  1. Containers made from the gentoo/current image ignore shutdown signals from the host, so that ‘lxc stop’ doesn’t work:
user@host Sa Jun 29 09:34:09 ~ $ lxc list
+-----------+---------+------+------+------------+-----------+
|   NAME    |  STATE  | IPV4 | IPV6 |    TYPE    | SNAPSHOTS |
+-----------+---------+------+------+------------+-----------+
| gentooC03 | STOPPED |      |      | PERSISTENT | 0         |
+-----------+---------+------+------+------------+-----------+
user@host Sa Jun 29 14:27:13 ~ $ lxc start gentooC03
user@host Sa Jun 29 14:27:24 ~ $ lxc list
+-----------+---------+---------------------+------+------------+-----------+
|   NAME    |  STATE  |        IPV4         | IPV6 |    TYPE    | SNAPSHOTS |
+-----------+---------+---------------------+------+------------+-----------+
| gentooC03 | RUNNING | 10.24.21.154 (eth0) |      | PERSISTENT | 0         |
+-----------+---------+---------------------+------+------------+-----------+
user@host Sa Jun 29 14:27:26 ~ $ lxc stop gentooC03

lxc stop hangs indefinitely:

$ ps -ef | grep lxc
...
user  17909  6044  0 14:27 pts/6    00:00:00 lxc stop gentooC03
...

$ strace -p 17909
strace: Process 17909 attached
epoll_pwait(4, 

The only way to shut down the container is to enter it with ‘lxc exec /bin/bash’ and execute ‘shutdown -h now’. This is not ideal; not responding to signals means that host shutdown is delayed.

  1. It tries to spawn ttys from init before giving up. See Gentoo image; ttys die for my example.

Fixing lxc stop and only having getty run on /dev/console are things we should absolutely fix in our images, @monstermunchkin

All our images are built using https://github.com/lxc/distrobuilder with the production configuration files stored at https://github.com/lxc/lxc-ci/tree/master/images

This problem was discussed here before. This PR should fix the issue.