- Status Closed
- Percent Complete
- Task Type Bug Report
- Category Base system
-
Assigned To
Petr Štetiar - Operating System All
- Severity Medium
- Priority Very Low
- Reported Version openwrt-19.07
- Due in Version Undecided
-
Due Date
Undecided
- Private
Opened by Peter Geis - 09.12.2019
Last edited by Petr Štetiar - 24.01.2020
FS#2666 - procd: reboot inside lxc container causes shutdown
- Device problem occurs on
armvirt64
- Software versions of OpenWrt/LEDE release, packages, etc.
openwrt-19.07-rc2
- Steps to reproduce
Create a lxc package from the openwrt-19.07-rc2 rootfs package.
Start a lxc container using the openwrt lxc package.
Initiate a `reboot` command from inside the container.
Expected result: Container reboots.
Actual result: Container halts.
Current Version openwrt-19.07-rc2.
While running in a lxc container, initiating a reboot from openwrt results in a shutdown of the container instead of rebooting the container.
This appears to have been caused by commit <832369078d818d19ab64051fdc8da9e06c90ad88> state: fix shutdown when running in a container ( FS#2425 ).
Instead of triggering reboot(reboot_event);, it detects that it is inside a container and exits pid 1, resulting in the container halting.
There is a patch at [0] to resolve this, but would likely break the original intention of the fix above.
24.01.2020 07:45
Reason for closing: Fixed
Additional comments about closing:
Fixed in https:/ /git.openwrt.org/8038846b62edff5fbe20f6c 4cc8050b9fd401f80
Add a link button has a maximum character limit which truncated the reference link.
Reference Link:
[0] https://github.com/mikma/lxd-openwrt/blob/master/patches/procd-master/0001-state-support-reboot-of-containers.patch
Hi,
I've just tried following:
and it works as expected, it doesnt hang, so probably lxd/lxc does it differently. I don't have any prior experience with lxc/lxd, can you provide exact commands one has to run in order to reproduce it?
In other words, following commands:
provides following debugging log output:
I would like to get the same logs from LXC container running under LXD.
Are you running an OpenWrt LXC container on an OpenWrt host? Or an OpenWrt container on a host running another distribution? (Debian, Fedora...)
I can test OpenWrt LXC container on a x86_64 host running Debian, but I want to make sure it's really the same setup as you :)
Also, how do you prepare your image? Usually I just dump openwrt-x86-64-rootfs-ext4.img to a LVM volume.
To create a container:
Edit `/var/lib/lxc/openwrt/config`:
Start container:
To debug if it doesn't work, add -F.
To connect to the container:
To look at the current container state:
When testing here, on a x86_64 host running Arch Linux and LXC 3.2.1, indeed a reboot causes the container to shut down.
Hmm, couldn't get any useful log:
Ok, the DBGLVL=5 should go in /var/lib/lxc/openwrt/config:
Then I get some debug:
Petr, your patch https://gitlab.com/ynezz/openwrt-procd/commit/aa8689ccdff0124f3d477f86433496aeb2c49d24 fixes the issue, you can add my Tested-By.
I've tested with both LXC 2.0.7 on Debian and LXC 3.2.1 on Arch Linux.
Confirmed your patch
fixes the issue on Ubuntu 19.10 LXD 3.18.
Tested-by: Peter Geis pgwipeout@gmail.com