]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config
authorMichael Adam <obnox@samba.org>
Fri, 2 Jan 2015 20:12:21 +0000 (21:12 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 5 Jan 2015 21:25:37 +0000 (16:25 -0500)
This is to prevent systemd-journald to enter a 100% cpu loop.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
templates/lxc-fedora.in

index 65e99598ca6ed0c3df4fe050004ab96d9c96f80a..2296de411bbadb34518c01f6f0e5f6555ca5b640 100644 (file)
@@ -1083,13 +1083,22 @@ lxc.include = @LXCTEMPLATECONFIG@/fedora.common.conf
 " >> $config_path/config
     fi
 
+    if [ "x$have_systemd" = "x1" ]; then
+        cat <<EOF >> $config_path/config
+lxc.autodev = 1
+lxc.kmsg = 0
+EOF
+    else
+        cat <<EOF >> $config_path/config
+lxc.autodev = 0
+EOF
+    fi
+
     # Append things which require expansion here...
     cat <<EOF >> $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