Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmake/install_layout.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock"
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
SET(INSTALL_RUNDATADIR_RPM "/run/mariadb")
SET(INSTALL_PAMDIR_RPM "/${INSTALL_LIBDIR_RPM}/security")
SET(INSTALL_PAMDATADIR_RPM "/etc/security")

Expand Down Expand Up @@ -197,6 +198,7 @@ SET(INSTALL_UNIX_ADDRDIR_DEB "/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
SET(INSTALL_RUNDATADIR_DEB "/run/mariadb")
SET(INSTALL_PAMDIR_DEB "/lib/${CMAKE_CXX_LIBRARY_ARCHITECTURE}/security")
SET(INSTALL_PAMDATADIR_DEB "/etc/security")

Expand Down Expand Up @@ -257,3 +259,7 @@ IF(NOT MYSQL_UNIX_ADDR)
SET(MYSQL_UNIX_ADDR ${INSTALL_UNIX_ADDRDIR})
ENDIF()

IF(NOT INSTALL_RUNDATADIR)
get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
SET(INSTALL_RUNDATADIR "${MYSQL_UNIX_DIR}" CACHE FILEPATH "Rundata installation directory" ${FORCE})
ENDIF()
3 changes: 0 additions & 3 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,6 @@ ELSE()
SET(localstatedir ${MYSQL_DATADIR})
ENDIF()

get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
SET(mysqlunixdir ${MYSQL_UNIX_DIR})

SET(resolveip_locations "$basedir/${INSTALL_BINDIR} $basedir/bin")
SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin $basedir/bin")
SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mariadb/english $basedir/share/mysql/english")
Expand Down
4 changes: 2 additions & 2 deletions scripts/galera_new_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ EOF
exit 0
fi

echo _WSREP_NEW_CLUSTER='--wsrep-new-cluster' > @mysqlunixdir@/"wsrep-new-cluster" && \
echo _WSREP_NEW_CLUSTER='--wsrep-new-cluster' > "@INSTALL_RUNDATADIR@/wsrep-new-cluster" && \
systemctl restart mariadb.service

extcode=$?

rm -f @mysqlunixdir@/"wsrep-new-cluster"
rm -f "@INSTALL_RUNDATADIR@/wsrep-new-cluster"

exit $extcode
6 changes: 3 additions & 3 deletions support-files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ IF(UNIX AND NOT WITHOUT_SERVER)
RENAME mariadb.conf COMPONENT Server)
ENDIF()

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)
IF((HAVE_SYSTEMD OR INSTALL_SYSTEMD_TMPUSERS) AND INSTALL_SYSTEMD_TMPFILESDIR
AND INSTALL_RUNDATADIR)
IF(MYSQL_DATADIR STREQUAL INSTALL_RUNDATADIR)
SET(DISABLE_TMP "#")
ENDIF()
CONFIGURE_FILE(tmpfiles.conf.in
Expand Down
6 changes: 3 additions & 3 deletions support-files/mariadb.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ ProtectSystem=full
ProtectHome=true

# Use an environment file to pass variable _WSREP_NEW_CLUSTER
EnvironmentFile=-@mysqlunixdir@/wsrep-new-cluster
EnvironmentFile=-@INSTALL_RUNDATADIR@/wsrep-new-cluster

# Use an environment file to pass variable _WSREP_START_POSITION
EnvironmentFile=-@mysqlunixdir@/wsrep-start-position
EnvironmentFile=-@INSTALL_RUNDATADIR@/wsrep-start-position

@SYSTEMD_EXECSTARTPRE@

Expand All @@ -82,7 +82,7 @@ EnvironmentFile=-@mysqlunixdir@/wsrep-start-position
# Do not panic if galera_recovery script is not available. (MDEV-10538)
ExecStartPre=/bin/sh -c "[ ! -e @bindir@/galera_recovery ] && VAR= || \
VAR=`@bindir@/galera_recovery`; [ $? -eq 0 ] \
&& echo _WSREP_START_POSITION=$VAR > @mysqlunixdir@/wsrep-start-position || exit 1"
&& echo _WSREP_START_POSITION=$VAR > @INSTALL_RUNDATADIR@/wsrep-start-position || exit 1"

# Needed to create system tables etc.
# ExecStartPre=@scriptdir@/mariadb-install-db -u mysql
Expand Down
2 changes: 1 addition & 1 deletion support-files/tmpfiles.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# 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@ -
@DISABLE_TMP@d @INSTALL_RUNDATADIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -