DisplaySync/ docs

Crash recovery

The desktop sign app is stable enough that the watchdog rarely fires in practice. But "rarely" isn't "never," and a sign showing a Windows error dialog at the wrong moment is a worse outcome than one that briefly showed the QR screen before reconnecting. This page covers the watchdog mechanism and the maintenance-mode escape hatch that lets you safely take a sign down for hardware work.

The watchdog is the Scheduled Task that already auto-starts the sign app at logon (set up in Kiosk configuration). The same task definition does the watchdog job — Windows' Scheduled Task service handles restart-on-failure natively.

How it works

The relevant settings on the DisplaySync Sign task:

$settings = New-ScheduledTaskSettingsSet `
  -AllowStartIfOnBatteries `
  -DontStopIfGoingOnBatteries `
  -RestartCount 3 `
  -RestartInterval (New-TimeSpan -Minutes 1) `
  -ExecutionTimeLimit (New-TimeSpan -Hours 0)

What each does:

SettingEffect
RestartCount 3If the app exits non-zero, restart up to 3 times
RestartInterval 1 minuteWait 1 minute between restart attempts
ExecutionTimeLimit 0Never time the task out (defaults to 72 hours, which is way too short for a sign expected to run for months)
AllowStartIfOnBatteries / DontStopIfGoingOnBatteriesDon't kill the sign app on power-state changes

So if the Electron process crashes outright, Windows will relaunch it within 60 seconds. If three relaunches in a row all fail, the task gives up — at which point the device is in a state that needs human attention anyway.

Verify the task is installed correctly

Get-ScheduledTask -TaskName "DisplaySync Sign" |
  Format-List TaskName, State, Triggers, Actions

Get-ScheduledTaskInfo -TaskName "DisplaySync Sign"

Look for:

  • State: Ready (or Running if the app is currently up)
  • Triggers: one entry, AtLogOn, user DisplaySync
  • NumberOfMissedRuns: 0
  • LastRunTime: the most recent boot

If LastTaskResult isn't 0 after a recent boot, something failed during launch — check the application log (see below).

Where to find logs

When the watchdog fires, you usually want to know why the previous run died. Two log sources:

LogPathWhat's in it
App logC:\Users\DisplaySync\AppData\Local\displaysync-sign\logs\app.logElectron main-process stdout/stderr, captures the last seconds before a crash
Task scheduler historyEvent Viewer → Task Scheduler / OperationalTask start/stop events, restart attempts, why the task gave up

The dashboard's Fetch Logs command pulls app.log and surfaces it in the UI — usually faster than RDP'ing in. See Operations → Remote Control.

To clear logs (e.g., a misbehaving sign filled the disk):

Remove-Item "C:\Users\DisplaySync\AppData\Local\displaysync-sign\logs\*"

Maintenance mode

The watchdog has a deliberate escape hatch: if the file C:\ProgramData\DisplaySync\.maintenance exists, the watchdog refuses to relaunch the app. This lets you cleanly exit the kiosk for hardware swaps, BIOS updates, or any work that requires the desktop without the app fighting you.

There are two ways to enter maintenance mode:

From the kiosk (keyboard shortcut)

While the sign app is focused, press Ctrl + Shift + Q. The app:

  1. Creates C:\ProgramData\DisplaySync\.maintenance
  2. Notifies the backend that the sign is going into maintenance (so the dashboard reflects it)
  3. Exits cleanly

The watchdog sees the sentinel and skips the relaunch. The desktop appears, and you can plug in a keyboard, RDP in, etc.

Remotely (PowerShell)

# Enter maintenance mode
New-Item -Path "C:\ProgramData\DisplaySync\.maintenance" -ItemType File -Force

# Stop the running app (the watchdog will not restart it)
Stop-Process -Name "DisplaySync Sign" -Force -ErrorAction SilentlyContinue

Useful when you need a sign in maintenance mode but you can't reach the keyboard.

Exiting maintenance mode

Two paths back to normal operation:

  • Manual launch: double-click the app from the desktop or Start menu. The app deletes the .maintenance sentinel on successful launch and re-engages the watchdog.
  • Reboot: the next boot's auto-login + scheduled task launch removes the sentinel and resumes normal operation.

Both work. Reboot is the more common choice because it also clears any other lingering state from the maintenance window (open File Explorer windows, Notepad, etc.).

What the watchdog does not protect against

A few failure modes that are out of scope for the Scheduled Task watchdog and need different mitigations:

Failure modeWatchdog reacts?Mitigation
Electron main process crashes✓ relaunches in under 1 min
Electron renderer hangs but main is aliveThe app's internal renderer-watchdog detects unresponsive UI and triggers a clean restart
Whole machine BSODsBIOS auto-power-on after AC restore (set in Base Windows setup)
Display driver crash, app survives but screen is blackRestart from the dashboard (Remote Control)
Network drops, app reconnects but content URL unreachableContent reachability monitor — the dashboard surfaces failed URLs, you fix the content side
Hardware failureField swap — see USB recovery drive

The Scheduled Task is the cheapest, most reliable layer in a defense-in-depth stack. It's not the only one.

Verify before moving on

Confirm the watchdog is wired up before you capture the image:

# Task exists, ready, and points at the correct exe
Get-ScheduledTask -TaskName "DisplaySync Sign" |
  Select-Object TaskName, State,
    @{n="Path";e={ $_.Actions[0].Execute }}

# .maintenance sentinel does NOT exist (would block first boot)
Test-Path "C:\ProgramData\DisplaySync\.maintenance"

# Logs directory exists and is writable by the kiosk user
Test-Path "C:\Users\DisplaySync\AppData\Local\displaysync-sign\logs"

Test-Path for the maintenance sentinel should be False. If it's True, delete it before capturing — otherwise every cloned image boots into maintenance mode.

Next: Testing the image — cold boot, offline mode, and claim validation before Sysprep.