Skip to content

Commit 621926e

Browse files
eworm-deLinuxJedi
authored andcommitted
MDEV-19210: update galera_new_cluster to use environment file
Now that the systemd unit files use an environment file to pass _WSREP_START_POSITION we have to update galera_new_cluster as well.
1 parent 7936254 commit 621926e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

scripts/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ ELSE()
206206
SET(localstatedir ${MYSQL_DATADIR})
207207
ENDIF()
208208

209+
get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
210+
SET(mysqlunixdir ${MYSQL_UNIX_DIR})
211+
209212
SET(resolveip_locations "$basedir/${INSTALL_BINDIR} $basedir/bin")
210213
SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin $basedir/bin")
211214
SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mariadb/english $basedir/share/mysql/english")
@@ -224,6 +227,18 @@ IF(UNIX AND NOT WITHOUT_SERVER)
224227
COMPONENT Server)
225228

226229
INSTALL_LINK(mariadb-install-db mysql_install_db ${INSTALL_SCRIPTDIR} ServerSymlinks)
230+
231+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/galera_new_cluster.sh
232+
${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster ESCAPE_QUOTES @ONLY)
233+
EXECUTE_PROCESS(
234+
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster
235+
)
236+
237+
INSTALL_SCRIPT(
238+
"${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster"
239+
DESTINATION ${INSTALL_SCRIPTDIR}
240+
COMPONENT Server
241+
)
227242
ENDIF()
228243

229244
SET(prefix "${CMAKE_INSTALL_PREFIX}")

scripts/galera_new_cluster.sh

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ EOF
2121
exit 0
2222
fi
2323

24-
systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
24+
echo _WSREP_NEW_CLUSTER='--wsrep-new-cluster' > @mysqlunixdir@/"wsrep-new-cluster" && \
2525
systemctl restart ${1:-mariadb}
2626

2727
extcode=$?
2828

29-
systemctl set-environment _WSREP_NEW_CLUSTER=''
29+
rm -f @mysqlunixdir@/"wsrep-new-cluster"
3030

3131
exit $extcode

0 commit comments

Comments
 (0)