fix(#1329): restart hive-matrix-daemon after token write so new credential is picked up immediately
This commit is contained in:
parent
92b32d06fb
commit
f201f04d4e
4 changed files with 52 additions and 0 deletions
|
|
@ -280,6 +280,17 @@ pub async fn write_agent_matrix_token(agent_name: &str, token: &str) -> Result<(
|
|||
.await?)
|
||||
}
|
||||
|
||||
/// Restart `hive-matrix-daemon.service` inside an agent container via
|
||||
/// `systemctl --machine=h-<agent_name> restart hive-matrix-daemon.service`.
|
||||
/// Non-fatal: callers should handle errors gracefully — if the container is
|
||||
/// not running the restart will fail (the unit starts naturally on next boot).
|
||||
pub async fn restart_matrix_daemon(agent_name: &str) -> Result<()> {
|
||||
ok(call(&PrivRequest::RestartMatrixDaemon {
|
||||
agent_name: agent_name.to_owned(),
|
||||
})
|
||||
.await?)
|
||||
}
|
||||
|
||||
fn check(resp: PrivResponse) -> Result<(String, String)> {
|
||||
if resp.ok {
|
||||
Ok((resp.stdout, resp.stderr))
|
||||
|
|
|
|||
Loading…
Reference in a new issue