aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-13 10:41:59 +0200
committerGitHub <noreply@github.com>2021-10-13 10:41:59 +0200
commitf12dc28bbc12376783064c645093715ef6831bd1 (patch)
treeaefd2efdfaf940a8f626e051c60eb703cc12f4a6 /libpod
parent0b8673d0e7c335e7edbaf5e4d0393ed409f08efe (diff)
parent3ba69dccf78194792a4b0156db8c69417b20a713 (diff)
downloadpodman-f12dc28bbc12376783064c645093715ef6831bd1.tar.gz
podman-f12dc28bbc12376783064c645093715ef6831bd1.tar.bz2
podman-f12dc28bbc12376783064c645093715ef6831bd1.zip
Merge pull request #11565 from Luap99/rootlessport-bin
rootlessport: reduce memory usage of the process
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_slirp4netns.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/libpod/networking_slirp4netns.go b/libpod/networking_slirp4netns.go
index 46cda89a9..ffd53ec2b 100644
--- a/libpod/networking_slirp4netns.go
+++ b/libpod/networking_slirp4netns.go
@@ -484,10 +484,14 @@ func (r *Runtime) setupRootlessPortMappingViaRLK(ctr *Container, netnsPath strin
}
cfgR := bytes.NewReader(cfgJSON)
var stdout bytes.Buffer
- cmd := exec.Command(fmt.Sprintf("/proc/%d/exe", os.Getpid()))
- cmd.Args = []string{rootlessport.ReexecKey}
- // Leak one end of the pipe in rootlessport process, the other will be sent to conmon
+ path, err := r.config.FindHelperBinary(rootlessport.BinaryName, false)
+ if err != nil {
+ return err
+ }
+ cmd := exec.Command(path)
+ cmd.Args = []string{rootlessport.BinaryName}
+ // Leak one end of the pipe in rootlessport process, the other will be sent to conmon
if ctr.rootlessPortSyncR != nil {
defer errorhandling.CloseQuiet(ctr.rootlessPortSyncR)
}