Cloud & Backend Engineer: Architecting Resilient Linux systemd Daemons, Watchdogs & ARM64 Edge Gateways
Deploying autonomous industrial IoT gateways, warehouse barcode scanners, or edge AI inference nodes on Linux ARM64 devices (Raspberry Pi CM4/5, NVIDIA Jetson Orin, or bare-metal Debian servers) presents operational hazards that cloud containers never face: sudden power loss, intermittent LTE/Starlink connectivity, SD/eMMC flash wear-out, and hung hardware serial buses. As a Cloud Engineer and Backend Engineer, I engineer self-healing Linux systemd services with hardware watchdog heartbeats (`sd_notify`), cgroup v2 resource isolation, and offline SQLite WAL store-and-forward buffers.
1. Hardened systemd Unit Files with `sd_notify` Watchdogs & Sandboxing
A process that deadlocks on a blocked USB/RS-485 serial descriptor stays alive as a zombie PID (`State=running`), so a basic `Restart=on-failure` policy will never recover it. By enabling `Type=notify` and `WatchdogSec=15s`, the Python or Go daemon must actively ping the systemd supervisor over `$NOTIFY_SOCKET` every 5 seconds after verifying its internal event loop and hardware health—or systemd forcibly sends `SIGABRT` and restarts the service cleanly:
# /etc/systemd/system/edge-telemetry-agent.service
[Unit]
Description=AFCOM Industrial ARM64 Edge Telemetry & Inference Daemon
After=network-online.target time-sync.target
Wants=network-online.target
[Service]
Type=notify
User=edgeagent
Group=dialout
WorkingDirectory=/opt/edge-agent
ExecStart=/opt/edge-agent/bin/edge-daemon --config /etc/edge-agent/config.toml
Restart=always
RestartSec=3s
WatchdogSec=15s
# cgroup v2 resource bounds & filesystem sandboxing
MemoryMax=512M
CPUQuota=80%
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
NoNewPrivileges=true
ReadWritePaths=/var/lib/edge-agent
[Install]
WantedBy=multi-user.target
2. Offline-First SQLite WAL Ring Buffers & Atomic A/B OTA Updates
To prevent eMMC flash corruption during power outages and survive 48-hour network blackouts, our edge daemon writes sensor frames to a bounded local SQLite database in PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL; mode and streams compressed batches upstream once mTLS connectivity to our AWS IoT / Google Cloud infrastructure or Remote Edge Gateway fleet is restored.
Need a Cloud Engineer or Backend Engineer to build rock-solid Linux systemd daemons and ARM64 edge software? Book a 1-Day Engineering Sprint.