Skip to content

Commit

Permalink
Revert "update galera_new_cluster to use environment file"
Browse files Browse the repository at this point in the history
This reverts commit b54e4bf.
  • Loading branch information
LinuxJedi committed Aug 8, 2023
1 parent 277968a commit 48e6918
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
15 changes: 0 additions & 15 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,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/mysql/english")
Expand All @@ -210,18 +207,6 @@ INSTALL_SCRIPT(
DESTINATION ${INSTALL_SCRIPTDIR}
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()

SET(prefix "${CMAKE_INSTALL_PREFIX}")
Expand Down
4 changes: 2 additions & 2 deletions scripts/galera_new_cluster.sh
100644 → 100755
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-${1:-mariadb}" && \
systemctl set-environment _WSREP_NEW_CLUSTER='--wsrep-new-cluster' && \
systemctl restart ${1:-mariadb}

extcode=$?

rm -f @mysqlunixdir@/"wsrep-new-cluster-${1:-mariadb}"
systemctl set-environment _WSREP_NEW_CLUSTER=''

exit $extcode
3 changes: 0 additions & 3 deletions support-files/mariadb.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ ProtectSystem=full
# Prevent accessing /home, /root and /run/user
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
EnvironmentFile=-@mysqlunixdir@/wsrep-start-position

Expand Down

0 comments on commit 48e6918

Please sign in to comment.