diff options
Diffstat (limited to 'pkg/cgroups')
-rw-r--r-- | pkg/cgroups/cgroups.go | 5 | ||||
-rw-r--r-- | pkg/cgroups/systemd.go | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index 9cb32a364..4bb8de69b 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -231,7 +231,10 @@ func getCgroupPathForCurrentProcess() (string, error) { for s.Scan() { text := s.Text() procEntries := strings.SplitN(text, "::", 2) - cgroupPath = procEntries[1] + // set process cgroupPath only if entry is valid + if len(procEntries) > 1 { + cgroupPath = procEntries[1] + } } if err := s.Err(); err != nil { return cgroupPath, err diff --git a/pkg/cgroups/systemd.go b/pkg/cgroups/systemd.go index 9bbdca415..f26988c5a 100644 --- a/pkg/cgroups/systemd.go +++ b/pkg/cgroups/systemd.go @@ -58,7 +58,7 @@ func systemdCreate(path string, c *systemdDbus.Conn) error { you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, |