/etc/init.de/qemu-guest-agent start shows OK despite failing Had made an own kernel missing virtio serial, qemu guest agent didn't run. Took some log inspection and internet searching to find out virtio serial could be missing in the kernel. This bug is minor, yet responsible for two unnecessary reboots because "not working" isn't signaled when it should and comes as a surprise later. Reproducible: Always Steps to Reproduce: 1. make kernel missing virtio serial 2. emerge qemu-guest-agent and start script Actual Results: startup script shows always [OK] despite qemu-ga not being started Expected Results: startup script should not show [OK] if qemu-ga fails being started
Yeah, this is because the init script passes '-d' flag which causes two things: 1) qemu-ga daemonizes itself, unnecessarily. start-stop-daemon already does that, 2) due to a bug in qemu-ga, it fails to report error onto stderr and fails to return EXIT_FAILURE. Patches for 2) are posted here: https://lists.nongnu.org/archive/html/qemu-devel/2024-11/msg00460.html I'll open a MR to drop '-d' flag in a while.
Huh, spoke too soon. Apparently 'start-stop-daemon --background' returns success even when the daemon fails to start. Guess we'll need to patch qemu-ga sources anyway.
v2: https://mail.gnu.org/archive/html/qemu-devel/2024-12/msg01073.html