spiegel_podman/cmd/podman/system/service_abi_linux.go
Matt Heon 72f1617fac Bump Go module to v5
Moving from Go module v4 to v5 prepares us for public releases.

Move done using gomove [1] as with the v3 and v4 moves.

[1] https://github.com/KSubedi/gomove

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-02-08 09:35:39 -05:00

28 lines
821 B
Go

//go:build linux && !remote
package system
import (
"github.com/containers/common/pkg/cgroups"
"github.com/containers/common/pkg/servicereaper"
"github.com/containers/podman/v5/pkg/rootless"
"github.com/sirupsen/logrus"
)
// Currently, we only need servicereaper on Linux to support slirp4netns.
func maybeStartServiceReaper() {
servicereaper.Start()
}
func maybeMoveToSubCgroup() {
cgroupv2, _ := cgroups.IsCgroup2UnifiedMode()
if rootless.IsRootless() && !cgroupv2 {
logrus.Warnf("Running 'system service' in rootless mode without cgroup v2, containers won't survive a 'system service' restart")
}
if err := cgroups.MaybeMoveToSubCgroup(); err != nil {
// it is a best effort operation, so just print the
// error for debugging purposes.
logrus.Debugf("Could not move to subcgroup: %v", err)
}
}