summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Dahl <ada@thorsis.com>2019-08-09 14:25:58 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-08-13 09:34:50 +0200
commitfa8c2d0bade2aed7e1428943bc85cc660e76c9b0 (patch)
tree0b3aea635f18ef8a32680825ca85ce926345854f
parentcf15dbf97974810b9bd839037776d01f2e7f14cf (diff)
downloadptxdist-fa8c2d0bade2aed7e1428943bc85cc660e76c9b0.tar.gz
ptxdist-fa8c2d0bade2aed7e1428943bc85cc660e76c9b0.tar.xz
mosquitto: Add systemd service unit
Signed-off-by: Alexander Dahl <ada@thorsis.com> [mol: fix dependencies] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/mosquitto.in8
-rw-r--r--rules/mosquitto.make11
2 files changed, 18 insertions, 1 deletions
diff --git a/rules/mosquitto.in b/rules/mosquitto.in
index 7ed65bf34..4d8717118 100644
--- a/rules/mosquitto.in
+++ b/rules/mosquitto.in
@@ -5,6 +5,7 @@ menuconfig MOSQUITTO
prompt "mosquitto "
select OPENSSL if MOSQUITTO_TLS
select C_ARES if MOSQUITTO_SRV
+ select SYSTEMD if MOSQUITTO_SYSTEMD_UNIT
help
Open source MQTT message broker, library, and client.
@@ -14,6 +15,13 @@ config MOSQUITTO_BROKER
bool
prompt "Broker"
+config MOSQUITTO_SYSTEMD_UNIT
+ bool
+ default y
+ select MOSQUITTO_BROKER
+ depends on INITMETHOD_SYSTEMD
+ prompt "install systemd unit file"
+
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)