mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Dahl <ada@thorsis.com>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH v2 4/4] mosquitto: Add systemd service unit
Date: Fri,  9 Aug 2019 14:25:58 +0200	[thread overview]
Message-ID: <20190809122558.19065-5-ada@thorsis.com> (raw)
In-Reply-To: <20190809122558.19065-1-ada@thorsis.com>

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 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

      parent reply	other threads:[~2019-08-09 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 12:25 [ptxdist] [PATCH v2 0/4] mosquitto: Version bump and systemd support Alexander Dahl
2019-08-09 12:25 ` [ptxdist] [PATCH v2 1/4] rootfs: Add 'mosquitto' user and group Alexander Dahl
2019-08-09 12:25 ` [ptxdist] [PATCH v2 2/4] mosquitto: Install default config file Alexander Dahl
2019-08-09 12:25 ` [ptxdist] [PATCH v2 3/4] mosquitto: version bump 1.4.14 -> 1.6.4 Alexander Dahl
2019-08-09 12:25 ` Alexander Dahl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190809122558.19065-5-ada@thorsis.com \
    --to=ada@thorsis.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox