* [ptxdist] [PATCH v2 1/4] rootfs: Add 'mosquitto' user and group
2019-08-09 12:25 [ptxdist] [PATCH v2 0/4] mosquitto: Version bump and systemd support Alexander Dahl
@ 2019-08-09 12:25 ` Alexander Dahl
2019-08-09 12:25 ` [ptxdist] [PATCH v2 2/4] mosquitto: Install default config file Alexander Dahl
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-08-09 12:25 UTC (permalink / raw)
To: ptxdist
Allow the mosquitto broker to drop priviledges.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
projectroot/etc/group | 1 +
projectroot/etc/passwd | 1 +
2 files changed, 2 insertions(+)
diff --git a/projectroot/etc/group b/projectroot/etc/group
index 96f7578d3..3e4a4be39 100644
--- a/projectroot/etc/group
+++ b/projectroot/etc/group
@@ -22,6 +22,7 @@ lock:x:114:
audio:x:115:
input:x:116:
mysql:x:117:
+mosquitto:x:118:
systemd-journal:x:201:
systemd-network:x:202:
systemd-journal-gateway:x:206:
diff --git a/projectroot/etc/passwd b/projectroot/etc/passwd
index 9b35a54de..d15650b38 100644
--- a/projectroot/etc/passwd
+++ b/projectroot/etc/passwd
@@ -6,6 +6,7 @@ tss:x:98:98:TSS Daemon User:/dev/null:/bin/false
sshd:x:100:65534:SSH Server:/var/run/sshd:/bin/false
mysql:x:101:117:mySQL Server:/var/run/mysql:/bin/false
messagebus:x:103:104:messagebus:/dev/null:/bin/false
+mosquitto:x:104:118:Mosquitto broker user:/dev/null:/bin/false
systemd-network:x:202:202:systemd-network:/dev/null:/bin/false
systemd-resolve:x:203:65534:systemd-resolve:/dev/null:/bin/false
systemd-timesync:x:204:65534:systemd-timesync:/dev/null:/bin/false
--
2.20.1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 2/4] mosquitto: Install default config file
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 ` 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 ` [ptxdist] [PATCH v2 4/4] mosquitto: Add systemd service unit Alexander Dahl
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-08-09 12:25 UTC (permalink / raw)
To: ptxdist
The broker service should run with a config file, but we can't use the
example installed with the default install stage with
'install_alternative' in targetinstall stage (wrong place), so we
install it a second time to a place better suitable.
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
rules/mosquitto.make | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/rules/mosquitto.make b/rules/mosquitto.make
index 6d3002a82..63cd2dca5 100644
--- a/rules/mosquitto.make
+++ b/rules/mosquitto.make
@@ -54,6 +54,16 @@ MOSQUITTO_INSTALL_OPT := \
$(MOSQUITTO_MAKE_OPT) \
install
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+$(STATEDIR)/mosquitto.install:
+ @$(call targetinfo)
+ @$(call world/install, MOSQUITTO)
+ @install -v -D -m644 $(MOSQUITTO_DIR)/mosquitto.conf \
+ $(MOSQUITTO_PKGDIR)/etc/mosquitto/mosquitto.conf
+ @$(call touch)
+
# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------
@@ -77,6 +87,8 @@ endif
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)
endif
@$(call install_finish, mosquitto)
--
2.20.1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 3/4] mosquitto: version bump 1.4.14 -> 1.6.4
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 ` Alexander Dahl
2019-08-09 12:25 ` [ptxdist] [PATCH v2 4/4] mosquitto: Add systemd service unit Alexander Dahl
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-08-09 12:25 UTC (permalink / raw)
To: ptxdist
This includes a lot of security fixes, bug fixes, fixed build issues,
new features, and removed features. See ChangeLog for details:
https://mosquitto.org/ChangeLog.txt
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
rules/mosquitto.in | 5 -----
rules/mosquitto.make | 14 ++++++++++----
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/rules/mosquitto.in b/rules/mosquitto.in
index d7eb813c1..7ed65bf34 100644
--- a/rules/mosquitto.in
+++ b/rules/mosquitto.in
@@ -5,7 +5,6 @@ menuconfig MOSQUITTO
prompt "mosquitto "
select OPENSSL if MOSQUITTO_TLS
select C_ARES if MOSQUITTO_SRV
- select LIBUUID if MOSQUITTO_UUID
help
Open source MQTT message broker, library, and client.
@@ -27,10 +26,6 @@ config MOSQUITTO_SRV
bool
prompt "SRV lookup support"
-config MOSQUITTO_UUID
- bool
- prompt "UUID as client id"
-
endif
# vim: ft=kconfig noet tw=72
diff --git a/rules/mosquitto.make b/rules/mosquitto.make
index 63cd2dca5..4faabf783 100644
--- a/rules/mosquitto.make
+++ b/rules/mosquitto.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_MOSQUITTO) += mosquitto
#
# Paths and names
#
-MOSQUITTO_VERSION := 1.4.14
-MOSQUITTO_MD5 := 6b0966e93f118bc71ad7b61600a6c2d3
+MOSQUITTO_VERSION := 1.6.4
+MOSQUITTO_MD5 := c89df444afb121d795f8af5b4fd97d78
MOSQUITTO := mosquitto-$(MOSQUITTO_VERSION)
MOSQUITTO_SUFFIX := tar.gz
MOSQUITTO_URL := https://mosquitto.org/files/source/$(MOSQUITTO).$(MOSQUITTO_SUFFIX)
@@ -43,13 +43,19 @@ MOSQUITTO_MAKE_OPT := \
WITH_PERSISTENCE=yes \
WITH_MEMORY_TRACKING=yes \
WITH_SYS_TREE=yes \
+ WITH_SYSTEMD=no \
WITH_SRV=$(call ptx/yesno, PTXCONF_MOSQUITTO_SRV) \
- WITH_UUID=$(call ptx/yesno, PTXCONF_MOSQUITTO_UUID) \
WITH_WEBSOCKETS=no \
WITH_EC=yes \
WITH_DOCS=no \
WITH_SOCKS=yes \
- WITH_ADNS=no
+ WITH_STRIP=yes \
+ WITH_STATIC_LIBRARIES=no \
+ WITH_SHARED_LIBRARIES=yes \
+ WITH_ADNS=no \
+ WITH_EPOLL=yes \
+ WITH_BUNDLED_DEPS=yes \
+ WITH_COVERAGE=no
MOSQUITTO_INSTALL_OPT := \
$(MOSQUITTO_MAKE_OPT) \
install
--
2.20.1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH v2 4/4] mosquitto: Add systemd service unit
2019-08-09 12:25 [ptxdist] [PATCH v2 0/4] mosquitto: Version bump and systemd support Alexander Dahl
` (2 preceding siblings ...)
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
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Dahl @ 2019-08-09 12:25 UTC (permalink / raw)
To: ptxdist
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
^ permalink raw reply [flat|nested] 5+ messages in thread