summaryrefslogtreecommitdiff
path: root/cmd/podman/main_local.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-24 01:20:25 +0200
committerGitHub <noreply@github.com>2019-10-24 01:20:25 +0200
commit674dc2bc750161ab19db79417db1831af45b0c75 (patch)
tree6aea92e6dc757d520fce9c118c1d70e8daa371a6 /cmd/podman/main_local.go
parent299a430759c236400188dcf77c7da2a97649cdcb (diff)
parent13fe146840c4d9d27fd509189735ce0fc7b944f8 (diff)
downloadpodman-674dc2bc750161ab19db79417db1831af45b0c75.tar.gz
podman-674dc2bc750161ab19db79417db1831af45b0c75.tar.bz2
podman-674dc2bc750161ab19db79417db1831af45b0c75.zip
Merge pull request #4228 from giuseppe/detect-no-systemd-session
rootless: detect no system session with --cgroup-manager=systemd
Diffstat (limited to 'cmd/podman/main_local.go')
-rw-r--r--cmd/podman/main_local.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index bdffb6b1e..202d93b35 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -174,14 +174,13 @@ func setupRootless(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
-
+ conf, err := runtime.GetConfig()
+ if err != nil {
+ return err
+ }
if !ownsCgroup {
unitName := fmt.Sprintf("podman-%d.scope", os.Getpid())
if err := utils.RunUnderSystemdScope(os.Getpid(), "user.slice", unitName); err != nil {
- conf, err2 := runtime.GetConfig()
- if err2 != nil {
- return err2
- }
if conf.CgroupManager == libpod.SystemdCgroupsManager {
logrus.Warnf("Failed to add podman to systemd sandbox cgroup: %v", err)
} else {