From patchwork Thu Feb 8 11:22:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Kundr=C3=A1t?= X-Patchwork-Id: 870834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=cesnet.cz header.i=@cesnet.cz header.b="ElCfuPI4"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcbqW5s7Kz9s7v for ; Thu, 8 Feb 2018 22:40:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 430BB88ACB; Thu, 8 Feb 2018 11:40:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E49QXABW3gVz; Thu, 8 Feb 2018 11:40:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EBA9088B4F; Thu, 8 Feb 2018 11:40:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3BAF71C1F4F for ; Thu, 8 Feb 2018 11:40:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3813B88B4F for ; Thu, 8 Feb 2018 11:40:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y3I45WOZnBx4 for ; Thu, 8 Feb 2018 11:40:47 +0000 (UTC) X-Greylist: delayed 00:08:45 by SQLgrey-1.7.6 Received: from office2.cesnet.cz (office2.cesnet.cz [195.113.144.244]) by whitealder.osuosl.org (Postfix) with ESMTPS id A34F488ACB for ; Thu, 8 Feb 2018 11:40:47 +0000 (UTC) Received: from localhost (unknown [IPv6:2001:718:1:5:cc6e:ab8d:a529:699]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 89D76400066 for ; Thu, 8 Feb 2018 12:31:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1518089519; bh=ITetTRfhw/FUnKc2K4CHVuQtaJXOV0CGt4nR0K1gOug=; h=Resent-Date:Resent-From:Resent-To:From:Date:Subject:To; b=ElCfuPI4Sruy227TY3/TITths6SKv6uCgVyi3FErkObQHbQixU/+pUVWuwDshxt9s dpfmAV5z1kljwBRtic6vN844WIm8ahD0gofQw2Q7E28yCHbFkEj3BzCmrhE0kRaZ13 ghGjoWZFddf/reIOg9fsrjT+V2nCv9G5scaAgcQo= Resent-Date: Thu, 08 Feb 2018 12:31:59 +0100 Resent-Message-ID: <9c9b3b7b-8896-4db8-95e2-12bca456d4fd@cesnet.cz> Resent-From: =?iso-8859-1?q?Jan_Kundr=E1t?= Resent-To: Message-Id: <45c17d05433e7bb40ff6e2b30c5cb41fed04ec76.1518089469.git.jan.kundrat@cesnet.cz> From: =?utf-8?q?Jan_Kundr=C3=A1t?= Date: Thu, 8 Feb 2018 12:22:21 +0100 MIME-Version: 1.0 To: buildroot@buildroot.org Subject: [Buildroot] [PATCH 1/3] systemd: Ensure /run and /var/run are the same on R/O rootfs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When I updated systemd from 234 to 237 and D-Bus from 1.12.0 to 1.12.2 on my system with a read-only rootfs (buildroot 1c0c55c028 to buildroot 27d2229692), my D-Bus-activated services stopped working. Checking the logs, it turned out that systemd PID 1 was not able to connect the D-Bus socket at all. There were some recent changes in systemd where upstream refactored code which waits for sockets to appear. However, the real problem is that systemd is configured to look for the D-Bus socket in /run/dbus, while D-Bus creates it at /var/run/dbus/. D-Bus upstream explains in a bugreport [1] that this "traditional" /var/run/dbus is going to stay because it's hardcoded in other independent implementations of the D-Bus APIs. As is also said in that bugreport, the root cause is that /run and /var/run are effectively two separate directories on Buildroot -- at least when configured for a R/O rootfs. Furthermore, systemd actually actively warns about this: systemd[1]: System is tainted: var-run-bad Looking further, systemd-tmpfiles also detects breakage: systemd-tmpfiles[172]: [/usr/lib/tmpfiles.d/var.conf:12] Duplicate line for path "/var/run", ignoring. systemd-tmpfiles[172]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring. systemd-tmpfiles[172]: [/usr/lib/tmpfiles.d/var.conf:21] Duplicate line for path "/var/lib", ignoring. This change simply skips /var/run from being copied from the /usr/share/factory. The symlink is still created by another tmpfiles.d entry which belongs to systemd. The other warnings are still in present: systemd-tmpfiles[174]: [/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring. systemd-tmpfiles[174]: [/usr/lib/tmpfiles.d/var.conf:21] Duplicate line for path "/var/lib", ignoring. I'm leaving that one to someone who is more familiar with systemd and buildroot conventions. My box now boots again, so I'm happy :). [1] https://bugs.freedesktop.org/show_bug.cgi?id=101628 Signed-off-by: Jan Kundrát --- package/skeleton-init-systemd/skeleton-init-systemd.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/skeleton-init-systemd/skeleton-init-systemd.mk b/package/skeleton-init-systemd/skeleton-init-systemd.mk index a2d4e8c4b3..95142904f5 100644 --- a/package/skeleton-init-systemd/skeleton-init-systemd.mk +++ b/package/skeleton-init-systemd/skeleton-init-systemd.mk @@ -42,7 +42,9 @@ define SKELETON_INIT_SYSTEMD_PRE_ROOTFS_VAR mkdir $(TARGET_DIR)/var for i in $(TARGET_DIR)/usr/share/factory/var/*; do \ j="$${i#$(TARGET_DIR)/usr/share/factory}"; \ - if [ -L "$${i}" ]; then \ + if [ "$${j}" = "/var/run" ]; then \ + echo "# $${j} is being handled by systemd" + elif [ -L "$${i}" ]; then \ printf "L+! %s - - - - %s\n" \ "$${j}" "../usr/share/factory/$${j}" \ || exit 1; \