1
0
mirror of https://github.com/rancher/os.git synced 2025-09-19 09:22:40 +00:00

Add systemd cgroup directory

(cherry picked from commit f6ebb5002e)
This commit is contained in:
Jason-ZW
2018-07-23 09:45:31 +08:00
committed by niusmallnan
parent b1d3274bce
commit 06b54536cf

View File

@@ -11,6 +11,8 @@ import (
"strings"
"syscall"
"golang.org/x/sys/unix"
"github.com/codegangsta/cli"
"github.com/rancher/os/cmd/cloudinitexecute"
"github.com/rancher/os/config"
@@ -108,6 +110,14 @@ func consoleInitFunc() error {
}
}
// mount systemd cgroups
if err := os.MkdirAll("/sys/fs/cgroup/systemd", 0555); err != nil {
log.Error(err)
}
if err := unix.Mount("cgroup", "/sys/fs/cgroup/systemd", "cgroup", 0, "none,name=systemd"); err != nil {
log.Error(err)
}
// font backslashes need to be escaped for when issue is output! (but not the others..)
if err := ioutil.WriteFile("/etc/issue", []byte(config.Banner), 0644); err != nil {
log.Error(err)