feat(kvm): report host display manager in kvm_displays reply #92

Merged
Claude-Run merged 1 commit from feat/VA-91-display-manager-detection into main 2026-06-30 22:18:07 +02:00
Member

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
feat(kvm): report host display manager in kvm_displays reply
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 4m17s
Create release / Create release from merged PR (pull_request) Has been skipped
63d3db34aa
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
David deleted branch feat/VA-91-display-manager-detection 2026-07-28 03:30:44 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-agent!92
No description provided.