From patchwork Sat Aug 3 09:38:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Titouan Christophe X-Patchwork-Id: 1141473 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=railnova.eu Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=railnova-eu.20150623.gappssmtp.com header.i=@railnova-eu.20150623.gappssmtp.com header.b="I9AQcLcR"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 460zWf1Vhdz9s7T for ; Sat, 3 Aug 2019 19:39:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6BA54882FB; Sat, 3 Aug 2019 09:39:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2niFS+JMhETx; Sat, 3 Aug 2019 09:39:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 709978831B; Sat, 3 Aug 2019 09:39:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 879571BF2F8 for ; Sat, 3 Aug 2019 09:39:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 85421203FD for ; Sat, 3 Aug 2019 09:39:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eyJ+ZaVa4Xad for ; Sat, 3 Aug 2019 09:39:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by silver.osuosl.org (Postfix) with ESMTPS id C432020396 for ; Sat, 3 Aug 2019 09:39:12 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id k21so74512225edq.3 for ; Sat, 03 Aug 2019 02:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=railnova-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B9jFhL624zq8k97VR9/JBuMvacpqTI7rYPMd0ETVLeg=; b=I9AQcLcRhQsjEV5igKHhrJAUM0YeqDIps6glK0y0djPfPScwzArXbhxZOJa0y5HC4N iHfJtg0rykedp/kUrG6oe9HOFfM5NIAooXh+PIHoTHxemRlwiwhDglu8Wz52lXdDsG7z GxlG3xn4iLj1SlmWqb6+wYZNQqxKLrqobO8GKZt5T4yiQtyyxm0vjponJBJZTb/xmlPa SBP3Tl9NdZZyGGYVS65WFuTs7OQHsj+A+iI9ms2bmWIezku/JtQJ3JrPHO7axNrk3Gq8 w9tAq+us9EyVD4qqYOSDgmuKMkaFDBGMswf3AWcoxs+OHRHEzjn13KEEruPLIqs4up+Y ELNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B9jFhL624zq8k97VR9/JBuMvacpqTI7rYPMd0ETVLeg=; b=O7d0TpRBzcp3MTf/pdmjlo3eAAKS4DsmeAuupCBjVt2xZ0fy6Fd+sGzEY42snRHpL0 zxw56FEzyjU5vexsaUvAke+V9lX2uG9hsNmGewez8ve3JItW4CmBfbhadvR2EwzC4yPF cngQpUZpcMo2OGaBwfm1ow3xc4ZlbU4EFzQAanAuVKfPgoA8iVQmke4EVqXtYBDVRCJk gJz5hWw1TEaIKPpoXD2L2S1c2qayCCVY8f97gSCRZE7OdR8zNuWfppcvTIlAFbvsMM9d vm/RRLHCpw/R0jY34tBytXo/JBRY4DVGqSJj1QanuTNB7XJmKusvKShvBU3D9RkKH4re CbtA== X-Gm-Message-State: APjAAAUqw8kq+B/gPpfUriR7MHZTiaD4yxRIhsmevUi4qpz4JChugULR NCzX6fhTkWUN3tXEvlR1yoE7JWLI7EA= X-Google-Smtp-Source: APXvYqx8ogdFTsjgxuOhb6mAVkU/ClOpGyPMj4lwnAFt3YYnAj6TJoICjB92X02nzIHaRfq9TO+y4g== X-Received: by 2002:a05:6402:8cc:: with SMTP id d12mr14292077edz.60.1564825150976; Sat, 03 Aug 2019 02:39:10 -0700 (PDT) Received: from taurus.home ([2a02:a03f:3c47:f000:1730:e68d:f08a:7dbc]) by smtp.gmail.com with ESMTPSA id gz5sm13584374ejb.21.2019.08.03.02.39.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Aug 2019 02:39:10 -0700 (PDT) From: Titouan Christophe To: buildroot@buildroot.org Date: Sat, 3 Aug 2019 11:38:57 +0200 Message-Id: <20190803093858.144555-3-titouan.christophe@railnova.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190803093858.144555-1-titouan.christophe@railnova.eu> References: <20190803093858.144555-1-titouan.christophe@railnova.eu> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/3] package/mosquitto: extend systemd integration X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Korsgaard , Titouan Christophe Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Since version 1.5, mosquitto can be built with explicit support for systemd. If enabled, libmosquitto will link against libsystemd: when started, the mosquitto broker notifies systemd that it is ready (ie. initialized and ready to accept connections), so that services that depend on the mqtt broker can be started only at that point. To enable this feature, the systemd service config file needs to change to Type=notify. Upstream now provides such a file, so we can remove ours. Signed-off-by: Titouan Christophe --- package/mosquitto/mosquitto.mk | 7 ++++++- package/mosquitto/mosquitto.service | 10 ---------- 2 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 package/mosquitto/mosquitto.service diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk index eb39f0af6e..6de6fc804f 100644 --- a/package/mosquitto/mosquitto.mk +++ b/package/mosquitto/mosquitto.mk @@ -29,6 +29,11 @@ else MOSQUITTO_MAKE_OPTS += WITH_SHARED_LIBRARIES=yes endif +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +MOSQUITTO_MAKE_OPTS += WITH_SYSTEMD=yes +MOSQUITTO_DEPENDENCIES += systemd +endif + # adns uses getaddrinfo_a ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y) MOSQUITTO_MAKE_OPTS += WITH_ADNS=yes @@ -102,7 +107,7 @@ define MOSQUITTO_INSTALL_INIT_SYSV endef define MOSQUITTO_INSTALL_INIT_SYSTEMD - $(INSTALL) -D -m 644 package/mosquitto/mosquitto.service \ + $(INSTALL) -D -m 644 $(@D)/service/systemd/mosquitto.service.notify \ $(TARGET_DIR)/usr/lib/systemd/system/mosquitto.service mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \ diff --git a/package/mosquitto/mosquitto.service b/package/mosquitto/mosquitto.service deleted file mode 100644 index 2d1939d1c7..0000000000 --- a/package/mosquitto/mosquitto.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Mosquitto MQTT broker - -[Service] -ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf -ExecReload=/bin/kill -HUP $MAINPID -Restart=always - -[Install] -WantedBy=multi-user.target