[systemd-devel] [PATCH] bootchart: ship a configuration that will boot without sysvinit compat

2014-12-27 Thread Gabriel de Perthuis
bootchart defaults to chaining to /sbin/init, which is sensible,
but in a pure systemd environment (without systemd-sysvinit)
will make the machine unbootable.

Change the default through /etc/systemd/bootchart.conf.
Keep the /sbin/init default in the source code, in case
some users rely on that.
---
 src/bootchart/bootchart.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bootchart/bootchart.conf b/src/bootchart/bootchart.conf
index c73328f..61ba0c1 100644
--- a/src/bootchart/bootchart.conf
+++ b/src/bootchart/bootchart.conf
@@ -14,11 +14,11 @@
 #Samples=500
 #Frequency=25
 #Relative=no
 #Filter=yes
 #Output=folder name, defaults to /run/log
-#Init=/path/to/init-binary
+Init=/usr/lib/systemd/systemd
 #PlotMemoryUsage=no
 #PlotEntropyGraph=no
 #ScaleX=100
 #ScaleY=20
 #ControlGroup=no
-- 
2.2.0.71.g3365589

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] loopback setup in unprivileged containers

2014-12-27 Thread Martin Pitt
Hello all,

I'm forwarding a patch for the loopback setup from Stéphane. I already
pushed one part of it as 
http://cgit.freedesktop.org/systemd/systemd/commit/?id=58a489c
which is trivial and obvious, but the other part isn't.

Thanks,

Martin

- Forwarded message from Stéphane Graber stgra...@ubuntu.com -

Date: Thu, 25 Dec 2014 22:17:52 +0100
From: Stéphane Graber stgra...@ubuntu.com
To: martin.p...@ubuntu.com
Subject: systemd patch for unprivileged containers
X-Spam-Status: No, score=-1.9 required=3.4 tests=BAYES_00 autolearn=no 
version=3.3.2

Hey Martin,

Attached is a pretty simple patch/workaround to fix the massive CPU
usage of systemd in unprivileged containers.

LXC provides each containers with an already-UP loopback device. systemd
will attempt to bring it up regardless of its current state and doing so
gets it into a broken codepath somewhere deep in the netlink handling
code of systemd.

The fix is to always check whether the loopback is ready to use before
doing anything.

I then noticed that this code path in systemd was broken too due to it
checking against 1.0.0.127 rather than 127.0.0.1 so I added the missing
htonl and now it all works as expected and systemd fails on the next
problem about a minute faster than it used to :)

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

- End forwarded message -

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From af71697dcc084b81f4c585c4b0c9dd6ac51b77d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= stgra...@ubuntu.com
Date: Sat, 27 Dec 2014 19:22:58 +0100
Subject: [PATCH] core: Optimize loopback setup

Check if the loopback device is already set up (like with LXC) before doing any
setup ourselves.
---
 src/core/loopback-setup.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c
index ab6335c..e46b70a 100644
--- a/src/core/loopback-setup.c
+++ b/src/core/loopback-setup.c
@@ -86,15 +86,15 @@ int loopback_setup(void) {
 _cleanup_rtnl_unref_ sd_rtnl *rtnl = NULL;
 int r;
 
+if (check_loopback())
+return 0;
+
 r = sd_rtnl_open(rtnl, 0);
 if (r  0)
 return r;
 
 r = start_loopback(rtnl);
-if (r == -EPERM) {
-if (check_loopback()  0)
-return log_warning_errno(EPERM, Failed to configure loopback device: %m);
-} else if (r  0)
+if (r  0)
 return log_warning_errno(r, Failed to configure loopback device: %m);
 
 
-- 
2.1.3



signature.asc
Description: Digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel