fix(meshtastic): ExecStartPre clears stale socket so the daemon survives restart (ref #897)
Some checks are pending
License Headers / check (push) Waiting to run

uvicorn/uvloop refuses to rebind an existing UDS ('Address already in use') →
crash-loop on restart. ExecStartPre=+/bin/rm -f the socket (root, clears any
owner in the sticky /run/secubox) before ExecStart.

Co-Authored-By: Gerald KERMA <devel@cybermind.fr>
This commit is contained in:
CyberMind-FR 2026-07-22 10:46:56 +02:00
parent 536bcd1c0f
commit db0ebe1675
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,12 @@
secubox-meshtastic (0.1.3-1~bookworm1) bookworm; urgency=medium
* Daemon survives a restart with a stale socket: uvicorn/uvloop refuses to
rebind an existing UDS ("Address already in use"), causing a crash-loop on
restart. Add ExecStartPre=+/bin/rm -f the socket (runs as root, clears it
regardless of owner in the sticky /run/secubox) before ExecStart.
-- Gerald KERMA <devel@cybermind.fr> Tue, 22 Jul 2026 14:00:00 +0200
secubox-meshtastic (0.1.2-1~bookworm1) bookworm; urgency=high
* SECURITY/regression fix: the postinst used `install -d -o root -g root` on

View File

@ -19,6 +19,10 @@ Group=secubox-meshtastic
# others rely on the cgroup device controller).
SupplementaryGroups=dialout
WorkingDirectory=/usr/lib/secubox/meshtastic
# Clear a stale socket from an unclean prior stop — uvicorn/uvloop refuses to
# rebind an existing UDS ("Address already in use"). "+" runs as root so it
# works regardless of the stale socket's owner in the sticky shared dir.
ExecStartPre=+/bin/rm -f /run/secubox/meshtastic.sock
ExecStart=/usr/sbin/secubox-meshtasticd
Restart=on-failure
RestartSec=5

View File

@ -19,6 +19,10 @@ Group=secubox-meshtastic
# others rely on the cgroup device controller).
SupplementaryGroups=dialout
WorkingDirectory=/usr/lib/secubox/meshtastic
# Clear a stale socket from an unclean prior stop — uvicorn/uvloop refuses to
# rebind an existing UDS ("Address already in use"). "+" runs as root so it
# works regardless of the stale socket's owner in the sticky shared dir.
ExecStartPre=+/bin/rm -f /run/secubox/meshtastic.sock
ExecStart=/usr/sbin/secubox-meshtasticd
Restart=on-failure
RestartSec=5