-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd-based containers not initializing properly #5831
Comments
Unlikely to be a LXD bug, far more likely to be systemd crashing on missing cgroup configuration or kernel feature. Closing the bug but we can still keep chatting here to track down the issue with your setup. |
What does |
When systemd itself is unhappy about something, you usually end up with a container which only has PID1 running and normally you get error output in the console log. |
Awesome, thanks a lot. I didn't know there is a console log. ps fauxww
console
SolutionBy, [1] and [2], the solution is to create a
1: https://wiki.debian.org/LXC#Incompatibility_with_systemd |
Required information
Debian
sid
Additional host information
LXD is built from source. The init system of the host is
runit
(runit-init
package).cgroupfs-mount
andlxcfs
are installed and active/running.apparmor
is installed and activated.I can provide a minimal bootable virtual disk image if it can help to debug the issue.
Issue description
systemd-based containers fail to start services.
lxc launch ubuntu:18.04 c1
, e.g., followed bylxc ls
indicates the container failed to acquire a network address. Also,lxc exec c1 -- ps auxf
indicates that only/sbin/init
is running.ptrace
-ing pid 1 shows that container entered its signals-waiting loop. Additionally,systemctl
fails, stating thatsystemd
is not pid 1 despite/sbin/init
being provided by thesystemd-sysv
package.Steps to reproduce
Follow the build instruction on https://lxd.readthedocs.io/
apparmor
,apparmor-utils
,apparmor-profiles-extra
(update GRUB's configuration accordingly)cgroupfs-mount
lxcfs
Make sure the last two services are activated/running.
lxd init
lxc launch ubuntu:18.04 c1
Debugging steps taken so far
strace
-ing/sbin/init
in the container, but the program seems to have anti-debugging "features". It simply stops trying to doptrace(PTRACE_ME)
. I replaced/sbin/init
with a script that logs some info before runningexec systemd --user
.lxd --debug
andlxc --debug
indicates no relevant messages apart fromold devpts
not being unmounted properly (identical to [1]).images:alpine/3.9
(OpenRC) andubuntu:trusty
(upstart) are starting properly.ubuntu:{xenial,bionic,disco}
all fail to start properly.Additional information
dhclient
directly and services can be started using the init scripts.1: https://discuss.linuxcontainers.org/t/warning-in-the-container-log/4072
The text was updated successfully, but these errors were encountered: