operserv: REHASH reloads config live without a restart
All checks were successful
CI / check (push) Successful in 3m54s
All checks were successful
CI / check (push) Successful in 3m54s
This commit is contained in:
parent
e112b8737c
commit
64b675e61f
8 changed files with 126 additions and 1 deletions
|
|
@ -169,6 +169,11 @@ pub enum NetAction {
|
|||
// link layer exits cleanly; `restart` exits non-zero so a supervisor (systemd
|
||||
// Restart=) brings it back. Never serialized.
|
||||
Shutdown { restart: bool, reason: String },
|
||||
// Internal only: re-read config.toml and apply the reloadable settings to the
|
||||
// running engine (OperServ REHASH). The link layer resolves it against the
|
||||
// engine and sends the outcome back to `requester` from `agent`. Never
|
||||
// serialized as-is.
|
||||
Rehash { requester: String, agent: String },
|
||||
}
|
||||
|
||||
// How to answer a registration once its credentials have been derived.
|
||||
|
|
@ -386,6 +391,13 @@ impl ServiceCtx {
|
|||
self.actions.push(NetAction::Shutdown { restart, reason: reason.into() });
|
||||
}
|
||||
|
||||
// Re-read config.toml and apply the reloadable settings live (OperServ REHASH).
|
||||
// The engine resolves this off the command path and notices `requester` from
|
||||
// `agent` with the outcome.
|
||||
pub fn rehash(&mut self, agent: &str, requester: &str) {
|
||||
self.actions.push(NetAction::Rehash { requester: requester.to_string(), agent: agent.to_string() });
|
||||
}
|
||||
|
||||
// Hand a password change to the engine to finish: its derivation runs off the
|
||||
// reactor, then the engine commits it and notices `uid`, sourced from `agent`.
|
||||
pub fn defer_password(&mut self, account: impl Into<String>, password: impl Into<String>, agent: impl Into<String>, uid: impl Into<String>) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue