diff --git a/CHANGELOG.md b/CHANGELOG.md index e6a20b4..c691d69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.10.0] - 2026-01-10 + +### Changed (BREAKING) + +- `CommandHandler::on_startup()` now receives `pid: u32` as second parameter + ## [0.9.0] - 2025-12-29 ### Changed (BREAKING) diff --git a/Cargo.toml b/Cargo.toml index edc5d07..f043077 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon-cli" -version = "0.9.0" +version = "0.10.0" edition = "2024" [dependencies] diff --git a/src/lib.rs b/src/lib.rs index 71afc56..4098519 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -421,10 +421,10 @@ where /// Called once when the daemon starts, before accepting connections. /// - /// Override this method to log the startup reason or perform + /// Override this method to log the startup reason and PID, or perform /// initialization that depends on whether this is a fresh start /// or a restart. /// /// The default implementation does nothing. - fn on_startup(&self, _reason: StartupReason) {} + fn on_startup(&self, _reason: StartupReason, _pid: u32) {} } diff --git a/src/server.rs b/src/server.rs index c0c81b7..4f77742 100644 --- a/src/server.rs +++ b/src/server.rs @@ -228,8 +228,8 @@ where "Daemon started and listening" ); - // Notify handler of startup reason - self.handler.on_startup(self.startup_reason); + // Notify handler of startup reason and PID + self.handler.on_startup(self.startup_reason, pid); loop { // Select between accepting connection and shutdown signal