support executing configurable admin commands via SIGUSR2

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-01-28 21:30:12 +00:00
commit 2c5af902a3
6 changed files with 72 additions and 19 deletions

View file

@ -1,7 +1,7 @@
pub mod console;
mod create;
mod execute;
mod grant;
mod startup;
use std::{
future::Future,
@ -183,7 +183,11 @@ impl Service {
.map(|complete| complete(command))
}
async fn handle_signal(&self, #[allow(unused_variables)] sig: &'static str) {
async fn handle_signal(&self, sig: &'static str) {
if sig == execute::SIGNAL {
self.signal_execute().await.ok();
}
#[cfg(feature = "console")]
self.console.handle_signal(sig).await;
}