diff --git a/libcitadel/src/realm/realm.rs b/libcitadel/src/realm/realm.rs index aa25b27..d41797d 100644 --- a/libcitadel/src/realm/realm.rs +++ b/libcitadel/src/realm/realm.rs @@ -389,6 +389,11 @@ impl Realm { self.leader_pid().map(|pid| PathBuf::from(format!("/proc/{}/root", pid))) } + pub fn pid_namespace(&self) -> Option { + let pid = self.leader_pid()?; + let path = symlink::read(format!("/proc/{}/ns/pid", pid))?; + path.to_str().map(|s| s.to_owned()) + } /// Query for 'leader pid' of realm nspawn instance with machinectl. /// The leader pid is the 'pid 1' of the realm container as seen from