diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-28 05:53:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 05:53:20 -0400 |
commit | f763e9c2c018e7088258951d2fd6075c114cd3df (patch) | |
tree | 618a4ec67de9e4ee8feb7ea46000036dff518957 /pkg | |
parent | d6b13d8a0993aced5e227e7a516aadbf37e14dbc (diff) | |
parent | f32eec6ba64c199077c1f717c1045d721ccb3947 (diff) | |
download | podman-f763e9c2c018e7088258951d2fd6075c114cd3df.tar.gz podman-f763e9c2c018e7088258951d2fd6075c114cd3df.tar.bz2 podman-f763e9c2c018e7088258951d2fd6075c114cd3df.zip |
Merge pull request #7455 from giuseppe/trim-init-command
abi: trim init command
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/abi/system.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index 478fac1d5..ff1052d86 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -8,6 +8,7 @@ import ( "os/exec" "path/filepath" "strconv" + "strings" "github.com/containers/common/pkg/config" "github.com/containers/podman/v2/libpod/define" @@ -73,7 +74,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, cmd *cobra.Command) initCommand, err := ioutil.ReadFile("/proc/1/comm") // On errors, default to systemd - runsUnderSystemd := err != nil || string(initCommand) == "systemd" + runsUnderSystemd := err != nil || strings.TrimRight(string(initCommand), "\n") == "systemd" unitName := fmt.Sprintf("podman-%d.scope", os.Getpid()) if runsUnderSystemd || conf.Engine.CgroupManager == config.SystemdCgroupsManager { |