Add an echorpc control CLI over gRPC: version/status/rehash live, start/stop/restart via systemctl
All checks were successful
CI / check (push) Successful in 5m40s

This commit is contained in:
Jean Chevronnet 2026-07-20 15:28:00 +00:00
parent d5a89baf53
commit 829a3916fd
No known key found for this signature in database
7 changed files with 198 additions and 9 deletions

View file

@ -950,6 +950,19 @@ impl Engine {
self.config_path = path.into();
}
// Whether our pseudo-clients have signed on to the uplink (a fresh burst sets
// `services_signon`), and for how long — for the Admin/`echorpc` status view.
pub fn linked(&self) -> bool {
self.services_signon > 0
}
pub fn uptime_secs(&self) -> u64 {
if self.services_signon == 0 {
0
} else {
self.now_secs().saturating_sub(self.services_signon)
}
}
// Re-read config.toml and apply the settings that are safe to change while
// linked, reporting the outcome to the oper who ran REHASH. A parse error
// keeps the running configuration untouched (validate-or-keep, like an ircd