diff --git a/stage1/init/init.go b/stage1/init/init.go index 4038172..caf3c90 100644 --- a/stage1/init/init.go +++ b/stage1/init/init.go @@ -218,23 +218,23 @@ func getArgsEnv(p *Pod, flavor, systemdVersion string, debug bool) ([]string, [] } else { args = append(args, fmt.Sprintf("--register=false")) } - - if util.IsRunningSystemd() { - // we write /etc/machine-id here because systemd-nspawn needs it to link - // the container's journal to the host - mPath := filepath.Join(common.Stage1RootfsPath(p.Root), "etc", "machine-id") - mId := strings.Replace(p.UUID.String(), "-", "", -1) - - if err := ioutil.WriteFile(mPath, []byte(mId), 0644); err != nil { - log.Fatalf("error writing /etc/machine-id: %v\n", err) - } - - args = append(args, "--link-journal=try-host") - } default: return nil, nil, fmt.Errorf("unrecognized stage1 flavor: %q", flavor) } + if util.IsRunningSystemd() { + // we write /etc/machine-id here because systemd-nspawn needs it to link + // the container's journal to the host + mPath := filepath.Join(common.Stage1RootfsPath(p.Root), "etc", "machine-id") + mId := strings.Replace(p.UUID.String(), "-", "", -1) + + if err := ioutil.WriteFile(mPath, []byte(mId), 0644); err != nil { + log.Fatalf("error writing /etc/machine-id: %v\n", err) + } + + args = append(args, "--link-journal=host") + } + if !debug { args = append(args, "--quiet") // silence most nspawn output (log_warning is currently not covered by this) }