Agent: bash script run hourly by a hardened systemd timer on Debian 12/13 and Ubuntu 24.04. Collects running vs installed kernel (needrestart when available), pending/security updates via a read-only apt simulation, reboot-required state and apt list freshness, and POSTs them as JSON. Server: stdlib-only Python + SQLite (system python3 >= 3.11). Token-bound ingest API, login-protected dashboard with per-host status (stale/reboot/update/ok) and history, admin CLI, systemd unit and installer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
521 B
Bash
15 lines
521 B
Bash
#!/bin/sh
|
|
# /usr/local/bin/kernelwatch — admin CLI wrapper. Runs as the service user so
|
|
# the database stays owned by it.
|
|
set -e
|
|
if [ "$(id -u)" = 0 ]; then
|
|
exec runuser -u kernelwatch -- env KERNELWATCH_CONFIG=/etc/kernelwatch/server.toml \
|
|
/usr/bin/python3 -I /opt/kernelwatch/kernelwatch-server "$@"
|
|
fi
|
|
if [ "$(id -un)" = kernelwatch ]; then
|
|
exec env KERNELWATCH_CONFIG=/etc/kernelwatch/server.toml \
|
|
/usr/bin/python3 -I /opt/kernelwatch/kernelwatch-server "$@"
|
|
fi
|
|
echo "kernelwatch: run with sudo" >&2
|
|
exit 1
|