Skip to contentSkip to conversation

mosquitto: fix build in systemd environments

PATCH In review Damien Riegel 2 participants 4 messages Mar 7, 2019 – Mar 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mosquitto: fix build in systemd environments

From: André Draszik <[email protected]>

The mosquitto systemd service file instructs systemd to wait for mosquitto to notify systemd that mosquitto has started correctly. This isn't working as mosquitto is not *compiled* with systemd support enabled. As such, systemd restarts mosquitto every few seconds.

For reference, this was introduced in commit a483d344d9fb ("mosquitto: Make enabling systemd also enable build dep on systemd")

Because we build mosquitto using the provided Makefile infrastructure, the solution is to add PACKAGECONFIG_CONFARGS to EXTRA_OEMAKE, so that the required make flags are added to the make command line.

[Damien Riegel: backport from master]

---

This is a backport from master. Patch has been modified to apply cleanly on the mosquitto_1.5.1.bb recipe.

 .../recipes-connectivity/mosquitto/mosquitto_1.5.1.bb            | 1 +
 1 file changed, 1 insertion(+)
meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb +1 -0
index b4adfdada..52252787d 100644
@@ -38,6 +38,7 @@ EXTRA_OEMAKE = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'ssl', 'WITH_TLS=yes WITH_TLS_PSK=yes', 'WITH_TLS=no WITH_TLS_PSK=no', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'uuid', 'WITH_UUID=yes', 'WITH_UUID=no', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'websockets', 'WITH_WEBSOCKETS=yes', 'WITH_WEBSOCKETS=no', d)} \
+    ${PACKAGECONFIG_CONFARGS} \
     STRIP=/bin/true \
     WITH_DOCS=no \
 "
Signature · 1 line
2.21.0
#1 lore raw

PATCH 2/2 mosquitto: fully switch over to using PACKAGECONFIG_CONFARGS

From: André Draszik <[email protected]>

Convert all other instances of explicit PACKAGECONFIG uses to the PACKAGECONFIG_CONFARGS infrastructure.

[Damien Riegel: backport from master]
---
 .../mosquitto/mosquitto_1.5.1.bb                     | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb +4 -8
index 52252787d..06c1d67da 100644
@@ -24,20 +24,16 @@ PACKAGECONFIG ??= "ssl uuid \
                   ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \
                   "
 
-PACKAGECONFIG[dns-srv] = ",,c-ares"
-PACKAGECONFIG[ssl] = ",,openssl"
-PACKAGECONFIG[uuid] = ",,util-linux"
+PACKAGECONFIG[dns-srv] = "WITH_SRV=yes,WITH_SRV=no,c-ares"
+PACKAGECONFIG[ssl] = "WITH_TLS=yes WITH_TLS_PSK=yes,WITH_TLS=no WITH_TLS_PSK=no,openssl"
+PACKAGECONFIG[uuid] = "WITH_UUID=yes,WITH_UUID=no,util-linux"
 PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd"
-PACKAGECONFIG[websockets] = ",,libwebsockets"
+PACKAGECONFIG[websockets] = "WITH_WEBSOCKETS=yes,WITH_WEBSOCKETS=no,libwebsockets"
 
 EXTRA_OEMAKE = " \
     prefix=${prefix} \
     mandir=${mandir} \
     localedir=${localedir} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'dns-srv', 'WITH_SRV=yes', 'WITH_SRV=no', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'ssl', 'WITH_TLS=yes WITH_TLS_PSK=yes', 'WITH_TLS=no WITH_TLS_PSK=no', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'uuid', 'WITH_UUID=yes', 'WITH_UUID=no', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'websockets', 'WITH_WEBSOCKETS=yes', 'WITH_WEBSOCKETS=no', d)} \
     ${PACKAGECONFIG_CONFARGS} \
     STRIP=/bin/true \
     WITH_DOCS=no \
Signature · 1 line
2.21.0
#2 lore raw
In reply to Damien Riegel
Quoted 17 lines · Damien Riegel

From: André Draszik <[email protected]>

The mosquitto systemd service file instructs systemd to wait for mosquitto to notify systemd that mosquitto has started correctly. This isn't working as mosquitto is not *compiled* with systemd support enabled. As such, systemd restarts mosquitto every few seconds.

For reference, this was introduced in commit a483d344d9fb ("mosquitto: Make enabling systemd also enable build dep on systemd")

Because we build mosquitto using the provided Makefile infrastructure, the solution is to add PACKAGECONFIG_CONFARGS to EXTRA_OEMAKE, so that the required make flags are added to the make command line.

Quoted 4 lines
[Damien Riegel: backport from master]

Armin, did you get a chance to take a look at these backport patches?

Thank you,

Signature · 1 line
Damien
#3 lore raw
Quoted 17 lines · Damien Riegel
Quoted 16 lines · Damien Riegel

From: André Draszik <[email protected]>

The mosquitto systemd service file instructs systemd to wait for mosquitto to notify systemd that mosquitto has started correctly. This isn't working as mosquitto is not *compiled* with systemd support enabled. As such, systemd restarts mosquitto every few seconds.

For reference, this was introduced in commit a483d344d9fb ("mosquitto: Make enabling systemd also enable build dep on systemd")

Because we build mosquitto using the provided Makefile infrastructure, the solution is to add PACKAGECONFIG_CONFARGS to EXTRA_OEMAKE, so that the required make flags are added to the make command line.

Quoted 5 lines
Quoted 4 lines
[Damien Riegel: backport from master]

Armin, did you get a chance to take a look at these backport patches?

Yes, i did.
https://git.openembedded.org/meta-openembedded-contrib/log/?h=stable/thud-nmut

should be moving them to thud-next shortly

- armin

Quoted 2 lines

Thank you,