"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/containers/common/pkg/config/systemd.go" between
podman-3.2.2.tar.gz and podman-3.2.3.tar.gz

About: podman (previous name "libpod") provides a library for applications looking to use the Container Pod concept, popularized by Kubernetes. Podman manages pods, containers, container images, and container volumes.

systemd.go  (podman-3.2.2):systemd.go  (podman-3.2.3)
// +build systemd // +build systemd
package config package config
import ( import (
"io/ioutil"
"strings"
"sync"
"github.com/containers/common/pkg/cgroupv2" "github.com/containers/common/pkg/cgroupv2"
"github.com/containers/storage/pkg/unshare" "github.com/containers/storage/pkg/unshare"
) )
var (
systemdOnce sync.Once
usesSystemd bool
)
func defaultCgroupManager() string { func defaultCgroupManager() string {
if !useSystemd() {
return CgroupfsCgroupsManager
}
enabled, err := cgroupv2.Enabled() enabled, err := cgroupv2.Enabled()
if err == nil && !enabled && unshare.IsRootless() { if err == nil && !enabled && unshare.IsRootless() {
return CgroupfsCgroupsManager return CgroupfsCgroupsManager
} }
return SystemdCgroupsManager return SystemdCgroupsManager
} }
func defaultEventsLogger() string { func defaultEventsLogger() string {
return "journald" if useSystemd() {
return "journald"
}
return "file"
}
func defaultLogDriver() string {
// If we decide to change the default for logdriver, it should be done he
re.
if useSystemd() {
return DefaultLogDriver
}
return DefaultLogDriver
}
func useSystemd() bool {
systemdOnce.Do(func() {
dat, err := ioutil.ReadFile("/proc/1/comm")
if err == nil {
val := strings.TrimSuffix(string(dat), "\n")
usesSystemd = (val == "systemd")
}
return
})
return usesSystemd
} }
 End of changes. 5 change blocks. 
1 lines changed or deleted 40 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)