Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Cannot start container when the rootfs has not systemd #1937

Closed
devimc opened this issue Aug 6, 2019 · 0 comments · Fixed by #1938
Closed

Cannot start container when the rootfs has not systemd #1937

devimc opened this issue Aug 6, 2019 · 0 comments · Fixed by #1938
Assignees
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.

Comments

@devimc
Copy link

devimc commented Aug 6, 2019

Description of problem

Generate an image with AGENT_INIT=yes and try to use it as rootfs

sudo -E USE_DOCKER=true DISTRO=clearlinux AGENT_INIT=yes EXTRA_PKGS="" make -e rootfs
sudo -E USE_DOCKER=true DISTRO=clearlinux AGENT_INIT=yes EXTRA_PKGS="" make -e image

Following error appears in the journal

[   18.881663] Freeing unused kernel image memory: 2024K
[   18.882308] Freeing unused kernel image memory: 636K
[   18.882635] Run /usr/lib/systemd/systemd as init process
[   18.883399] Kernel panic - not syncing: Requested init /usr/lib/systemd/systemd failed (error -2).
[   18.884005] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.52 #1
[   18.884533] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
[   18.884650] Call Trace:
[   18.884650]  dump_stack+0x5c/0x80
[   18.884650]  ? rest_init+0x50/0x95
[   18.884650]  panic+0xd2/0x214
[   18.884650]  ? __do_execve_file+0x9d/0x710
[   18.884650]  ? rest_init+0x95/0x95
[   18.884650]  kernel_init+0x9c/0xeb
[   18.884650]  ret_from_fork+0x35/0x40
[   18.884650] Kernel Offset: disabled
[   18.884650] Rebooting in 1 seconds..

Expected result

a container up and running

@devimc devimc added bug Incorrect behaviour needs-review Needs to be assessed by the team. labels Aug 6, 2019
@devimc devimc self-assigned this Aug 6, 2019
GabyCT pushed a commit that referenced this issue Aug 6, 2019
Currently kata sets the init process to systemd even when it isn't installed,
the criteria to determinate whether systemd is used as init or not
is very odd, since kata only checks whether the `image` option is set in the
configuration file, unfortunately not all images have systemd installed.
Instead kata should rely on the guest kernel and `osbuilder` to use the right
init process. `osbuilder` creates a symbolic link to `systemd` or `kata-agent`
depending on the `AGENT_INIT` environment variable.

fixes #1937

Signed-off-by: Julio Montes <[email protected]>
egernst pushed a commit to egernst/runtime that referenced this issue Aug 29, 2019
Currently kata sets the init process to systemd even when it isn't installed,
the criteria to determinate whether systemd is used as init or not
is very odd, since kata only checks whether the `image` option is set in the
configuration file, unfortunately not all images have systemd installed.
Instead kata should rely on the guest kernel and `osbuilder` to use the right
init process. `osbuilder` creates a symbolic link to `systemd` or `kata-agent`
depending on the `AGENT_INIT` environment variable.

fixes kata-containers#1937

Signed-off-by: Julio Montes <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Incorrect behaviour needs-review Needs to be assessed by the team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant