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

Signed-off-by: Danny Wood <danny@rotronics.co.uk>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
master
Danny Wood 2023-07-27 16:52:54 +01:00 committed by Thomas Petazzoni
parent bc8e70a08b
commit 1a9ad16ed8
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -9,6 +9,8 @@ Restart=always
User=mysql
RuntimeDirectory=mysql
RuntimeDirectoryMode=0755
Type=notify
NotifyAccess=all
[Install]
WantedBy=multi-user.target