feat(kvm): report host display manager in kvm_displays reply #92
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VA-91-display-manager-detection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Under a system install the agent runs as User=vervain-agent with ProtectSystem=strict / ProtectHome=true and no DISPLAY/WAYLAND_DISPLAY, so enumerate_displays() fails with NotAvailable and the server's Desktop tab renders blank. Detect the host's configured display manager so the tab always has content.
Add a Linux-only helper detect_display_manager() in vervain-agent-kvm that reads the symlink target of /etc/systemd/system/display-manager.service (basename with .service stripped is the name) and runs systemctl is-active display-manager.service for the active flag. Both inputs are reachable inside the hardened system unit: /etc stays readable under ProtectSystem=strict and is unaffected by ProtectHome=true, and systemctl reaches PID 1. The helper returns None on headless / non-systemd hosts and on every non-Linux target, so the display_manager field is omitted there.
Extend reply_kvm_displays to always attach a display_manager object { unit, name, active } when one is detected, regardless of whether enumeration succeeds. When enumeration returns NotAvailable (the expected system-install case) the reply is now ok=true with empty displays and available=false instead of a bare ok=false blank, giving the server a single positive signal to render alongside the display_manager context.
#VA-91
Under a system install the agent runs as User=vervain-agent with ProtectSystem=strict / ProtectHome=true and no DISPLAY/WAYLAND_DISPLAY, so enumerate_displays() fails with NotAvailable and the server's Desktop tab renders blank. Detect the host's configured display manager so the tab always has content. Add a Linux-only helper detect_display_manager() in vervain-agent-kvm that reads the symlink target of /etc/systemd/system/display-manager.service (basename with .service stripped is the name) and runs systemctl is-active display-manager.service for the active flag. Both inputs are reachable inside the hardened system unit: /etc stays readable under ProtectSystem=strict and is unaffected by ProtectHome=true, and systemctl reaches PID 1. The helper returns None on headless / non-systemd hosts and on every non-Linux target, so the display_manager field is omitted there. Extend reply_kvm_displays to always attach a display_manager object { unit, name, active } when one is detected, regardless of whether enumeration succeeds. When enumeration returns NotAvailable (the expected system-install case) the reply is now ok=true with empty displays and available=false instead of a bare ok=false blank, giving the server a single positive signal to render alongside the display_manager context. #VA-91