Files
RDtop/config/systemd/rustdesk-headless.service
Orchestrator 5020b591aa fix: install.sh — sleep-safe, auto-display, fresh-machine install
- install.sh now has 8 steps:
  1) Detect arch, 2) Install deps, 3) Disable sleep/lock/screensaver,
  4) Detect display, 5) Setup dummy + force DUMMY0 primary,
  6) Start Xorg/Xvfb, 7) Download+install RustDesk (with apt fallback),
  8) Install systemd unit rustdesk-headless.service

- New systemd unit: rustdesk-headless.service
  * Forces DUMMY0 as primary via ExecStartPre (no monitor selection dialog)
  * Restart=always — survives any crash
  * Wants=display-manager.service — starts after graphical session

- Sleep-safe changes:
  * Mask sleep.target suspend.target hibernate.target hybrid-sleep.target
  * logind.conf: HandleLidSwitch=ignore, IdleAction=ignore
  * GNOME screensaver: gsettings lock-enabled false, idle-delay 0
  * X11: xset s off -dpms

- Fresh machine fixes:
  * dpkg --force-depends --force-confnew (installs even with missing deps)
  * apt-get install -f after dpkg (fixes broken deps)
  * Fallback to 'apt-get install rustdesk' from repo if .deb download fails
  * Added libva-drm2 libva-x11-2 (fresh systems often miss these)

- Output at end:
  * ID, Password, Display (:0 DUMMY0 primary), Sleep/Lock status
  * Monitor status via xrandr --listmonitors

Fixes #7
2026-05-16 11:19:43 +01:00

41 lines
1.2 KiB
Desktop File

[Unit]
Description=RustDesk Headless Server (auto-display, sleep-safe)
After=display-manager.service graphical.target network.target
Wants=display-manager.service
[Service]
Type=simple
User=root
Environment="DISPLAY=:0"
Environment="XAUTHORITY=/root/.Xauthority"
Environment="LIBVA_DRIVER_NAME=none"
Environment="VDPAU_DRIVER=none"
Environment="LIBGL_ALWAYS_SOFTWARE=1"
Environment="LIBGL_ALWAYS_INDIRECT=1"
# Force DUMMY0 primary before starting
ExecStartPre=/bin/bash -c '\
for i in 1 2 3 4 5 6 7 8 9 10; do \
if xrandr >/dev/null 2>&1; then \
if xrandr | grep -q "^DUMMY0"; then \
xrandr --output DUMMY0 --mode "1920x1080" --primary 2>/dev/null || true; \
exit 0; \
fi; \
fi; \
sleep 1; \
done'
ExecStart=/usr/share/rustdesk/rustdesk --server
ExecStartPost=/bin/bash -c 'echo "RustDesk started, ID: $(/usr/share/rustdesk/rustdesk --get-id 2>/dev/null || echo unknown)" >> /tmp/rustdesk-server.log'
Restart=always
RestartSec=10
StartLimitInterval=60
StartLimitBurst=3
# Prevent system sleep while RustDesk is active
ExecStopPost=/bin/systemctl start --no-block rustdesk-headless-inhibit.service
[Install]
WantedBy=multi-user.target