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.
This commit is contained in:
parent
6c40590405
commit
b54e4bf00b
@ -190,6 +190,9 @@ ELSE()
|
|||||||
SET(localstatedir ${MYSQL_DATADIR})
|
SET(localstatedir ${MYSQL_DATADIR})
|
||||||
ENDIF()
|
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(resolveip_locations "$basedir/${INSTALL_BINDIR} $basedir/bin")
|
||||||
SET(mysqld_locations "$basedir/${INSTALL_SBINDIR} $basedir/libexec $basedir/sbin $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/mysql/english")
|
SET(errmsg_locations "$basedir/${INSTALL_MYSQLSHAREDIR}/english $basedir/share/english $basedir/share/mysql/english")
|
||||||
@ -207,6 +210,18 @@ INSTALL_SCRIPT(
|
|||||||
DESTINATION ${INSTALL_SCRIPTDIR}
|
DESTINATION ${INSTALL_SCRIPTDIR}
|
||||||
COMPONENT Server
|
COMPONENT Server
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/galera_new_cluster.sh
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster ESCAPE_QUOTES @ONLY)
|
||||||
|
EXECUTE_PROCESS(
|
||||||
|
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster
|
||||||
|
)
|
||||||
|
|
||||||
|
INSTALL_SCRIPT(
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/galera_new_cluster"
|
||||||
|
DESTINATION ${INSTALL_SCRIPTDIR}
|
||||||
|
COMPONENT Server
|
||||||
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(prefix "${CMAKE_INSTALL_PREFIX}")
|
SET(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
4
scripts/galera_new_cluster.sh
Executable file → Normal file
4
scripts/galera_new_cluster.sh
Executable file → Normal file
@ -21,11 +21,11 @@ EOF
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
|
echo _WSREP_NEW_CLUSTER='--wsrep-new-cluster' > @mysqlunixdir@/"wsrep-new-cluster-${1:-mariadb}" && \
|
||||||
systemctl restart ${1:-mariadb}
|
systemctl restart ${1:-mariadb}
|
||||||
|
|
||||||
extcode=$?
|
extcode=$?
|
||||||
|
|
||||||
systemctl set-environment _WSREP_NEW_CLUSTER=''
|
rm -f @mysqlunixdir@/"wsrep-new-cluster-${1:-mariadb}"
|
||||||
|
|
||||||
exit $extcode
|
exit $extcode
|
||||||
|
@ -70,6 +70,9 @@ ProtectSystem=full
|
|||||||
# Prevent accessing /home, /root and /run/user
|
# Prevent accessing /home, /root and /run/user
|
||||||
ProtectHome=true
|
ProtectHome=true
|
||||||
|
|
||||||
|
# Use an environment file to pass variable _WSREP_NEW_CLUSTER
|
||||||
|
EnvironmentFile=-@mysqlunixdir@/wsrep-new-cluster-%N
|
||||||
|
|
||||||
# Use an environment file to pass variable _WSREP_START_POSITION
|
# Use an environment file to pass variable _WSREP_START_POSITION
|
||||||
EnvironmentFile=-@mysqlunixdir@/wsrep-start-position
|
EnvironmentFile=-@mysqlunixdir@/wsrep-start-position
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user