Files
Button/webconfig/buttontask-collector.service
T
GrigoandClaude Opus 5.5 115879ab67 collector: survive bluetoothd hangs and restarts
- every BlueZ call runs off the asyncio thread with a timeout; if bluetoothd
  stays unresponsive for 30 s the collector restarts bluetooth.service and
  exits for a clean re-registration
- Type=notify + WatchdogSec for buttontask-collector, never give up restarting
- bluetooth.service drop-in: Restart=always (BlueZ 5.55 crashes on assert/SEGV),
  installed by device-install.sh and OTA (bt-update)
- bt-service: bluez-restart action for the collector

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 07:10:02 +00:00

28 lines
832 B
Desktop File

[Unit]
Description=ButtonTask BLE Sensor Collector
After=bluetooth.service dbus.service
Wants=bluetooth.service
# Never give up restarting: the collector exits on purpose whenever
# bluetoothd restarts or hangs, to re-register GATT/advertising from scratch.
StartLimitIntervalSec=0
[Service]
# Type=notify + watchdog: the collector sends READY=1 after GATT start and
# WATCHDOG=1 every loop tick; a stuck event loop gets killed and restarted.
Type=notify
NotifyAccess=main
WatchdogSec=60
TimeoutStartSec=90
User=buttontask
Group=buttontask
SupplementaryGroups=bluetooth
WorkingDirectory=/opt/buttontask/current/collector
Environment=BUTTONTASK_ROOT=/opt/buttontask
Environment=PYTHONUNBUFFERED=1
ExecStart=/usr/bin/python3 /opt/buttontask/current/collector/main.py
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target