style: rustfmt
This commit is contained in:
parent
14c2c6d4a5
commit
dce97f4826
1 changed files with 9 additions and 8 deletions
|
|
@ -331,9 +331,7 @@ async fn exec(req: PrivRequest, writer: &mut OwnedWriteHalf) -> Result<(String,
|
||||||
upgrade_agent_subvolume(agent_name).await
|
upgrade_agent_subvolume(agent_name).await
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivRequest::SyncAgentTmpfiles { ref agents } => {
|
PrivRequest::SyncAgentTmpfiles { ref agents } => sync_agent_tmpfiles(agents).await,
|
||||||
sync_agent_tmpfiles(agents).await
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1546,18 +1544,21 @@ async fn sync_agent_tmpfiles(agents: &[String]) -> Result<(String, String)> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build tmpfiles.d content. Root dirs first, then per-agent.
|
// Build tmpfiles.d content. Root dirs first, then per-agent.
|
||||||
let mut content = String::from(
|
let mut content =
|
||||||
"# managed by hive-c0re — do not edit (regenerated on spawn/destroy)\n",
|
String::from("# managed by hive-c0re — do not edit (regenerated on spawn/destroy)\n");
|
||||||
);
|
|
||||||
// Parent dirs — created with permissive mode so hive-c0re can make subdirs.
|
// Parent dirs — created with permissive mode so hive-c0re can make subdirs.
|
||||||
// /run/hyperhive itself is also a RuntimeDirectory of hive-c0re.service; the
|
// /run/hyperhive itself is also a RuntimeDirectory of hive-c0re.service; the
|
||||||
// tmpfiles.d entry here ensures it exists before hive-c0re starts (boot race).
|
// tmpfiles.d entry here ensures it exists before hive-c0re starts (boot race).
|
||||||
content.push_str("d /run/hyperhive 0750 hive-core hive-core -\n");
|
content.push_str("d /run/hyperhive 0750 hive-core hive-core -\n");
|
||||||
content.push_str(&format!("d {AGENT_RUNTIME_ROOT} 0755 hive-core hive-core -\n"));
|
content.push_str(&format!(
|
||||||
|
"d {AGENT_RUNTIME_ROOT} 0755 hive-core hive-core -\n"
|
||||||
|
));
|
||||||
content.push_str(&format!("d {SOCKET_DIR_ROOT} 0755 root root -\n"));
|
content.push_str(&format!("d {SOCKET_DIR_ROOT} 0755 root root -\n"));
|
||||||
// Per-agent dirs.
|
// Per-agent dirs.
|
||||||
for name in agents {
|
for name in agents {
|
||||||
content.push_str(&format!("d {AGENT_RUNTIME_ROOT}/{name} 0755 hive-core hive-core -\n"));
|
content.push_str(&format!(
|
||||||
|
"d {AGENT_RUNTIME_ROOT}/{name} 0755 hive-core hive-core -\n"
|
||||||
|
));
|
||||||
// 0777: agent harness (non-root uid) must bind sockets here.
|
// 0777: agent harness (non-root uid) must bind sockets here.
|
||||||
// `d` adjusts mode/owner on existing dirs; world-writable matches
|
// `d` adjusts mode/owner on existing dirs; world-writable matches
|
||||||
// the chmod_socket_dir(0o777) fallback so a runtime re-sync doesn't
|
// the chmod_socket_dir(0o777) fallback so a runtime re-sync doesn't
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue