lxc: Fix post-stop hook erroring on every container stop
The post-stop hook was set to
/dev/nullas a no-op. Its actual purpose (see #436) is to make LXC suppress auto-respawning the container when the guest reboots/crashes, since waydroid manages the session lifecycle itself – LXC suppresses the respawn when the post-stop hook exits non-zero, and /dev/null “achieves” this only because it is not executable.The side effect is that the hook fails on every container stop, including a normal shutdown, logging an error that users routinely misdiagnose:
lxc-start: waydroid: utils.c: run_buffer: 569 Script exited with status 126 lxc-start: waydroid: start.c: lxc_end: 1178 Failed to run lxc.hook.post-stop for container "waydroid"(Reproduced on LXC 7.0.0; status 126 is execve() of the non-executable /dev/null.)
Replace it with a real post-stop script that keys off LXC_TARGET: exit 0 on “stop” so a routine
waydroid session stopis clean, and non-zero otherwise (reboot, or an unset value on older LXC) to preserve the respawn-suppression. The script path is substituted into the generated config in set_lxc_config(), mirroring the existing LXCARCH handling.Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Waydroid
Waydroid uses a container-based approach to boot a full Android system on a regular GNU/Linux system.
Overview
Waydroid uses Linux namespaces (user, pid, uts, net, mount, ipc) to run a full Android system in a container and provide Android applications on any GNU/Linux-based platform.
The Android system inside the container has direct access to any needed hardware.
The Android runtime environment ships with a minimal customized Android system image based on LineageOS. The image is currently based on Android 13.
Install
See install instructions here
Documentation
Our documentation can be found at docs.waydro.id
Reporting bugs
If you have found an issue with Waydroid, please file a bug.
Get in Touch
If you want to get in contact with the developers please feel free to join the Waydroid groups in Matrix or Telegram.
Our website can be found at waydro.id