From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.thorsis.com ([92.198.35.195]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hw3yA-0008Tg-DF for ptxdist@pengutronix.de; Fri, 09 Aug 2019 14:26:07 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id F2FCF6EDD for ; Fri, 9 Aug 2019 14:26:37 +0200 (CEST) Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CkGwCSPKDk4i for ; Fri, 9 Aug 2019 14:26:37 +0200 (CEST) Received: from adahl by ada.ifak-system.com with local (Exim 4.89) (envelope-from ) id 1hw3y2-0004yO-5x for ptxdist@pengutronix.de; Fri, 09 Aug 2019 14:25:58 +0200 From: Alexander Dahl Date: Fri, 9 Aug 2019 14:25:58 +0200 Message-Id: <20190809122558.19065-5-ada@thorsis.com> In-Reply-To: <20190809122558.19065-1-ada@thorsis.com> References: <20190809122558.19065-1-ada@thorsis.com> Subject: [ptxdist] [PATCH v2 4/4] mosquitto: Add systemd service unit List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Signed-off-by: Alexander Dahl --- rules/mosquitto.in | 7 +++++++ rules/mosquitto.make | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/rules/mosquitto.in b/rules/mosquitto.in index 7ed65bf34..a2e53d7c4 100644 --- a/rules/mosquitto.in +++ b/rules/mosquitto.in @@ -14,6 +14,13 @@ config MOSQUITTO_BROKER bool prompt "Broker" +config MOSQUITTO_SYSTEMD_UNIT + bool + prompt "install systemd unit file" + default y + depends on MOSQUITTO_BROKER + depends on SYSTEMD + config MOSQUITTO_CLIENTS bool prompt "Clients" diff --git a/rules/mosquitto.make b/rules/mosquitto.make index 4faabf783..8a4967606 100644 --- a/rules/mosquitto.make +++ b/rules/mosquitto.make @@ -43,7 +43,7 @@ MOSQUITTO_MAKE_OPT := \ WITH_PERSISTENCE=yes \ WITH_MEMORY_TRACKING=yes \ WITH_SYS_TREE=yes \ - WITH_SYSTEMD=no \ + WITH_SYSTEMD=$(call ptx/yesno, PTXCONF_MOSQUITTO_SYSTEMD_UNIT) \ WITH_SRV=$(call ptx/yesno, PTXCONF_MOSQUITTO_SRV) \ WITH_WEBSOCKETS=no \ WITH_EC=yes \ @@ -68,6 +68,8 @@ $(STATEDIR)/mosquitto.install: @$(call world/install, MOSQUITTO) @install -v -D -m644 $(MOSQUITTO_DIR)/mosquitto.conf \ $(MOSQUITTO_PKGDIR)/etc/mosquitto/mosquitto.conf + @install -v -D -m644 $(MOSQUITTO_DIR)/service/systemd/mosquitto.service.notify \ + $(MOSQUITTO_PKGDIR)/usr/lib/systemd/system/mosquitto.service @$(call touch) # ---------------------------------------------------------------------------- @@ -95,6 +97,13 @@ ifdef PTXCONF_MOSQUITTO_BROKER @$(call install_copy, mosquitto, 0, 0, 0755, -, /usr/sbin/mosquitto) @$(call install_alternative, mosquitto, 0, 0, 0644, \ /etc/mosquitto/mosquitto.conf) + +ifdef PTXCONF_MOSQUITTO_SYSTEMD_UNIT + @$(call install_copy, mosquitto, 0, 0, 0644, -, \ + /usr/lib/systemd/system/mosquitto.service) + @$(call install_link, mosquitto, ../mosquitto.service, \ + /usr/lib/systemd/system/multi-user.target.wants/mosquitto.service) +endif endif @$(call install_finish, mosquitto) -- 2.20.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de