From 5b75ee4747c5f26c52cfb6127b6420f38f4fba88 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 2 Jan 2015 21:12:21 +0100 Subject: [PATCH] lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config This is to prevent systemd-journald to enter a 100% cpu loop. Signed-off-by: Michael Adam Acked-by: Serge E. Hallyn --- templates/lxc-fedora.in | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 65e99598c..2296de411 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -1083,13 +1083,22 @@ lxc.include = @LXCTEMPLATECONFIG@/fedora.common.conf " >> $config_path/config fi + if [ "x$have_systemd" = "x1" ]; then + cat <> $config_path/config +lxc.autodev = 1 +lxc.kmsg = 0 +EOF + else + cat <> $config_path/config +lxc.autodev = 0 +EOF + fi + # Append things which require expansion here... cat <> $config_path/config lxc.arch = $arch lxc.utsname = $utsname -lxc.autodev = $auto_dev - # When using LXC with apparmor, uncomment the next line to run unconfined: #lxc.aa_profile = unconfined @@ -1303,12 +1312,12 @@ if [ -z "$release" ]; then fi fi -# Fedora 15 and above run systemd. We need autodev enabled to keep +# Fedora 15 and above run systemd.We need autodev enabled to keep # systemd from causing problems. +# Also, kmsg must not be mapped to prevent a 100% cpu loop +# in systemd-journald. if [ $release -gt 14 ]; then - auto_dev="1" -else - auto_dev="0" + have_systemd="1" fi if [ "$(id -u)" != "0" ]; then -- 2.47.2