When building in schroot (for building Debian package),
the cgroupfs is not mounted in schroot (only sysfs is mounted).
Change-Id: Ieddac7b2f334d58d832f5d84d81af812badf3720
Reviewed-on: https://go-review.googlesource.com/c/go/+/460539
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
// Need an ability to create a sub-cgroup.
subCgroup, err := os.MkdirTemp(prefix+string(bytes.TrimSpace(cg)), "subcg-")
if err != nil {
- // Running in an unprivileged container, this may also return EROFS #57262.
- if os.IsPermission(err) || errors.Is(err, syscall.EROFS) {
+ // ErrPermission or EROFS (#57262) when running in an unprivileged container.
+ // ErrNotExist when cgroupfs is not mounted in chroot/schroot.
+ if os.IsNotExist(err) || os.IsPermission(err) || errors.Is(err, syscall.EROFS) {
t.Skip(err)
}
t.Fatal(err)