mirror of
https://github.com/containers/podman.git
synced 2025-10-20 04:34:01 +08:00
abi: trim init command
without it the systemd detection fails. Closes: https://github.com/containers/podman/issues/7441 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:

committed by
Brent Baude

parent
679da6c61b
commit
4da3677e3f
@ -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 {
|
||||
|
Reference in New Issue
Block a user