We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c5f6d1 commit 8d1f187Copy full SHA for 8d1f187
1 file changed
src/wrap.rs
@@ -643,8 +643,19 @@ impl AttachRequest {
643
.cgroupfs
644
.clone()
645
.unwrap_or("/sys/fs/cgroup".to_string());
646
- let cgroot = CGroup::open(&cgbase)?;
647
- let subtree = cgroot.create_child(format!("styrolite-{}", self.identity()?))?;
+ let name = format!("styrolite-{}", self.identity()?);
+
648
+ let mut path = PathBuf::from(&cgbase);
649
+ path.push(&name);
650
651
+ if !path.exists() {
652
+ return Ok(());
653
+ }
654
655
+ let path_str = path
656
+ .to_str()
657
+ .ok_or(anyhow!("path is somehow not valid utf-8"))?;
658
+ let subtree = CGroup::open(path_str)?;
659
660
debug!("binding supervisor (pid {pid}) to cgroup");
661
subtree
0 commit comments