[Unit] Description=BubbleCam BME280 sensor logger After=bubblecam-rtc-sync.service local-fs.target Wants=bubblecam-rtc-sync.service # Rate limiting belongs in [Unit] -- systemd ignores these keys under # [Service] ("Unknown key"), silently disabling the restart cap. StartLimitIntervalSec=300 StartLimitBurst=10 [Service] Type=simple ExecStart=/opt/bubblecam/bin/sensor_logger.py Restart=on-failure RestartSec=5 User=root # Sensor logging is mission-critical and tiny; never let it be the OOM # killer's pick when something larger (a camera/ffmpeg process) misbehaves. OOMScoreAdjust=-500 # Kept deliberately lower priority than camera capture -- at a 10s sample # cadence this almost never actually contends with ffmpeg, but the intent # should be explicit in the unit file. Nice=10 IOSchedulingClass=best-effort IOSchedulingPriority=7 [Install] WantedBy=multi-user.target