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.
This commit is contained in:
Daniel Black 2023-09-19 15:47:29 +10:00
parent a119c5f998
commit 6b2287fff2
2 changed files with 14 additions and 1 deletions

View file

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

View file

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