From 6b2287fff23fbdc362499501c562f01d0d2db52e Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 19 Sep 2023 15:47:29 +1000 Subject: [PATCH] MDEV-15543: tmpfile.d not for datadir With the default datadir path of /var/lib/mysql the same as the path of the unix socket, this tmpfiles.d file was generated to "create" a datadir. This wasn't intended. In this case we comment out the entry and explain why. Add extra ideas on other temporary directories that may be specified in this file. --- support-files/CMakeLists.txt | 3 +++ support-files/tmpfiles.conf.in | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt index 44ad8d0ae94..ee1d420e126 100644 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@ -212,6 +212,9 @@ IF(UNIX AND NOT WITHOUT_SERVER) IF((HAVE_SYSTEMD OR INSTALL_SYSTEMD_TMPUSERS) AND INSTALL_SYSTEMD_TMPFILESDIR) get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY) + IF(MYSQL_DATADIR STREQUAL MYSQL_UNIX_DIR) + SET(DISABLE_TMP "#") + ENDIF() CONFIGURE_FILE(tmpfiles.conf.in ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf diff --git a/support-files/tmpfiles.conf.in b/support-files/tmpfiles.conf.in index 03d66abc0c7..70de7a12fdb 100644 --- a/support-files/tmpfiles.conf.in +++ b/support-files/tmpfiles.conf.in @@ -1 +1,11 @@ -d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ - +# This is the directory where the unix socket +# of MariaDB is created. +# Other temporary directories can be created here like: +# * tmpdir +# * innodb_tmpdir +# * innodb_temp_data_file_path +# * rocksdb_tmpdir +# etc. +# It shouldn't be used for datadir which is why it +# may be disabled. +@DISABLE_TMP@d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -