summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-02-08 07:10:15 -0500
committerGitHub <noreply@github.com>2022-02-08 07:10:15 -0500
commitcbd0980d5b28fca1ea5192b73ccf92506e562691 (patch)
tree7d47dedfac33e65ca6b85cfc7f14b3e6be9b4f22 /libpod
parent46d9a2570ad3eb4f1d7fe0928927e644ebe8a2a3 (diff)
parent8d0fb0a4ed80eabf02b82c22d4d2b637d6a84da4 (diff)
downloadpodman-cbd0980d5b28fca1ea5192b73ccf92506e562691.tar.gz
podman-cbd0980d5b28fca1ea5192b73ccf92506e562691.tar.bz2
podman-cbd0980d5b28fca1ea5192b73ccf92506e562691.zip
Merge pull request #13159 from Luap99/slirp4-scope
move rootless netns slirp4netns process to systemd user.slice
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index f490ac626..e55e9d114 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -28,6 +28,7 @@ import (
"github.com/containers/podman/v4/pkg/resolvconf"
"github.com/containers/podman/v4/pkg/rootless"
"github.com/containers/podman/v4/pkg/util"
+ "github.com/containers/podman/v4/utils"
"github.com/containers/storage/pkg/lockfile"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
@@ -495,6 +496,12 @@ func (r *Runtime) GetRootlessNetNs(new bool) (*RootlessNetNS, error) {
return nil, err
}
+ // move to systemd scope to prevent systemd from killing it
+ err = utils.MoveRootlessNetnsSlirpProcessToUserSlice(cmd.Process.Pid)
+ if err != nil {
+ logrus.Errorf("failed to move the rootless netns slirp4netns process to the systemd user.slice: %v", err)
+ }
+
// build a new resolv.conf file which uses the slirp4netns dns server address
resolveIP, err := GetSlirp4netnsDNS(nil)
if err != nil {