Repository navigation
v0.8.0
·
40 commits
to master
since this release
This release introduces single-instance daemon enforcement via advisory file locks, a streamlined one-line installer with precompiled static musl binaries, and significant internal codebase decluttering through modularized unit tests.
🚀 What's New
🔒 Single-Instance Advisory Lock
- Prevent Concurrent Runs: Enforced an exclusive, non-blocking advisory file lock (
batmon.lock) on startup. Prevents multiple daemon instances from polling sensors or generating duplicate SQLite samples simultaneously (#12). - Helpful Collision Diagnostics: If an instance is already running, the new process identifies the existing PID, outputs troubleshooting information, and exits with a non-zero exit code so
systemdproperly honorsRestart=on-failure. - Robust Error Handling: Added proper I/O error propagation when writing PIDs and support for bare/relative lock paths.
⚡ One-Line Zero-Config Installer & Release Pipeline
- Curl-to-Bash Installer: Added a zero-dependency installation script (
install.sh) supporting auto-detection of Linux CPU architectures (x86_64,aarch64), pulling precompiled binaries directly from GitHub Releases. - Safe Installation Lifecycles: The installer now cleanly shuts down any running
batmonservice before file replacement and verification to avoid SQLite lock contention and database races. - Automated musl Builds: Integrated a GitHub Actions release pipeline to build static
muslbinaries with accompanying SHA256 checksums published with each release.
🧹 Code Quality & Refactoring
Test Module Extraction (#11)
- Extracted inline unit tests exceeding 100 lines across 16 core modules into dedicated child test modules (e.g.,
<module>/tests.rs). - Core engine logic across
alerts,thermal,daemon,cycles,sampler,processes,db,migrations,proc,config,battery,paths, anddbusis now significantly more readable and maintainable while maintaining test accessibility to private items.
📖 Documentation
- Quick Start: Promoted the copy-paste one-line installation command to the top of the
README.md. - Test Architecture Guide: Documented the internal test layout convention and instructions for using
git blame -w -C -C -Cto trace history across extracted test files.