8 Commits

Author SHA1 Message Date
Nikolay Metchev
5f19fe9c4c lxc: Fix post-stop hook erroring on every container stop
The post-stop hook was set to `/dev/null` as 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 stop` is 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>
2026-06-20 17:26:57 +02:00
GalaxySnail
7ef2b4fc0a Use command -v instead of which
See: <https://hynek.me/til/which-not-posix/>
2023-01-18 14:14:58 +01:00
Jami Kettunen
b910c89174 net: Don't fail start when already running
After 85843da (container: Make "waydroid-net.sh start" failure fatal)
this could result always failing to start unless you ran
"waydroid-net.sh stop" manually first; perhaps this should always be
stopped upon encountering errors?
2023-01-16 14:15:48 +01:00
Jami Kettunen
061a9fb06c net: Fix vnic name selection for LXC <=2
The "default to waydroid0" was broken as awk never returned a non-zero
exit code if the file exists but no match was found. Also account for
the key being named lxc.network.link on older LXC versions so one still
has the ability to have a flexible Waydroid network configuration.
2022-12-07 22:05:36 +01:00
Mitchel Stewart
5f808b2614 make waydroid-net more flexible (#267) 2022-07-14 19:52:55 +02:00
Florian Franzen
0f64f618e6 scripts: make sure misc subfolder exists 2022-01-10 09:04:21 +03:30
Erfan Abdi
22f671bf05 net: Disable NFT by default 2021-10-19 05:46:55 +03:30
Erfan Abdi
1f0393876d Waydroid: Initial commit 2021-08-27 20:10:54 +04:30