diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-27 13:40:29 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 13:40:29 -0400 |
commit | 9c8e0a0f2568d42aec47dd36103713f47ba4c0f2 (patch) | |
tree | c2a9242cb0a4ec8de449f5ed60ed9238ff9265df | |
parent | 679da6c61b0ca56ba8d67507b3f81c6d730afeba (diff) | |
parent | 4da3677e3f243de1cedca11976f156f980e132dc (diff) | |
download | podman-9c8e0a0f2568d42aec47dd36103713f47ba4c0f2.tar.gz podman-9c8e0a0f2568d42aec47dd36103713f47ba4c0f2.tar.bz2 podman-9c8e0a0f2568d42aec47dd36103713f47ba4c0f2.zip |
Merge pull request #7475 from baude/v2triminit
abi: trim init command
-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 043dfe49e..4f95588a9 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/libpod/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 { |