Skip to contentSkip to conversation

package/mariadb: add optional systemd dependency

PATCH In review Danny Wood 2 participants 4 messages Jul 28, 2023

lore
Share & tools
lore

Danny Wood

author
#0 lore raw

PATCH 1/1 package/mariadb: add optional systemd dependency

If systemd is used we should enable support in mariadb and enable "Type=notify" in the mysqld.service unit file

"Type=notify" stops systemd from starting services which depend on mariadb until it has notified systemd that it has finished starting up, this helps avoid startup race conditions

---
 package/mariadb/mariadb.mk     | 4 ++++
 package/mariadb/mysqld.service | 2 ++
 2 files changed, 6 insertions(+)
package/mariadb/mariadb.mk +4 -0
index a2701643e1..947cb7c0de 100644
@@ -72,6 +72,10 @@ MARIADB_CONF_OPTS += \
 	-DLIBRESSL_RESULT__TRYRUN_OUTPUT="LibreSSL $(LIBRESSL_VERSION)"
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MARIADB_DEPENDENCIES += systemd
+endif
+
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER_EMBEDDED),y)
 MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
package/mariadb/mysqld.service +2 -0
index 537430e9a2..9433e14630 100644
@@ -9,6 +9,8 @@ Restart=always
 User=mysql
 RuntimeDirectory=mysql
 RuntimeDirectoryMode=0755
+Type=notify
+NotifyAccess=all
 
 [Install]
 WantedBy=multi-user.target
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Danny,

package/mariadb/mariadb.mk MARIADB_CONF_OPTS += \ · line 77

Quoted 3 lines · On Fri, 28 Jul 2023 11:11:40 +0100 Danny Wood <[email protected]> wrote:
package/mariadb/mariadb.mk +3 -0
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MARIADB_DEPENDENCIES += systemd
+endif

Thanks for the patch. Is there some CMake option to explicitly enable/disable systemd support in mariadb? If yes, we will want to use them.

Thanks!

Thomas

Signature · 10 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com



_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#2 lore raw
Quoted 12 lines · Thomas Petazzoni

Hello Danny,

Review

Quoted 3 lines · On Fri, 28 Jul 2023 11:11:40 +0100 Danny Wood <[email protected]> wrote:
(quoted diff) +3 -0
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MARIADB_DEPENDENCIES += systemd
+endif

Thanks for the patch. Is there some CMake option to explicitly enable/disable systemd support in mariadb? If yes, we will want to use them.

Quoted 3 lines

Thanks!

Thomas

Yes there is.

I have updated my patch which is attached.

Thanks,
Danny

From d008133b9bf7fd237ffb01ff8404d94882f6554e Mon Sep 17 00:00:00 2001
From: Danny Wood <[email protected]>
Date: Thu, 27 Jul 2023 16:52:54 +0100
Subject: [PATCH 1/1] package/mariadb: add optional systemd dependency

If systemd is used we should enable support in mariadb and enable "Type=notify" in the mysqld.service unit file

"Type=notify" stops systemd from starting services which depend on mariadb until it has notified systemd that it has finished starting up, this helps avoid startup race conditions

---
 package/mariadb/mariadb.mk     | 7 +++++++
 package/mariadb/mysqld.service | 2 ++
 2 files changed, 9 insertions(+)
package/mariadb/mariadb.mk +7 -0
index a2701643e1..78e4703eee 100644
@@ -72,6 +72,13 @@ MARIADB_CONF_OPTS += \
 	-DLIBRESSL_RESULT__TRYRUN_OUTPUT="LibreSSL $(LIBRESSL_VERSION)"
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+MARIADB_DEPENDENCIES += systemd
+MARIADB_CONF_OPTS += -DWITH_SYSTEMD=yes
+else
+MARIADB_CONF_OPTS += -DWITH_SYSTEMD=no
+endif
+
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER),y)
 ifeq ($(BR2_PACKAGE_MARIADB_SERVER_EMBEDDED),y)
 MARIADB_CONF_OPTS += -DWITH_EMBEDDED_SERVER=ON
package/mariadb/mysqld.service +2 -0
index 537430e9a2..9433e14630 100644
@@ -9,6 +9,8 @@ Restart=always
 User=mysql
 RuntimeDirectory=mysql
 RuntimeDirectoryMode=0755
+Type=notify
+NotifyAccess=all
 
 [Install]
 WantedBy=multi-user.target
Signature · 1 line
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hello Danny,

Quoted 1 line · On Fri, 28 Jul 2023 13:23:45 +0100 Danny Wood <[email protected]> wrote:

I have updated my patch which is attached.

Thanks, I've applied this new iteration. However, we normally want new iterations to be sent again with "git send-email", with a prefix such as [PATCH v2] and a changelog. See
https://buildroot.org/downloads/manual/manual.html#submitting-patches
for some details.

Thanks for your contribution!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot