disabled
      disabled
  X   ˆl–Ü4ý('ÜZÔâ€vã,ÜÅ£“þZvEœl�É#ÍH „+MìÕÿ?Â{‹„„-i[D<†ªoZƒ›Ù«Ã558_‹I|¥Žƒî4ÃVŸÃÂ .    ‹      �TQ�Ó0~ï¯°îé6õÚx@›‡8/ã	!–µnÖ$U’²í¦ûï8n³íN÷„4i±ý}ögÇ©T­±ŽàÍ�ðPY£à*Ë{GöÇ]Í“$�Ãrƒp¼m¤Þ‚Câ„ïtá¥Ñ`Úðç2æ'Æ­
#˜jcp'ð	›­ã€ë”äÿŽ<*)n*>*£ý†$²QË¿¨)JâˆÇÔ]a%×ödð‡¿
+¡K²à†Û]{!ž2ù¢_´s`tÑ;�ºBk±ìgØ
çè,lÝ)ÔÞeð®iÌÎAç¤®÷µƒFn~®~,ßs±_×ï[7ËóZúM·Î
£ò ö¦Ò.ï|1Êžhþ†®kxÄƒjËŽÇâ¥é¸…`ÄwVG±Á]ÐŒHÕ¹CY¤¾•Œ}Òc �ŒÃlYTy–ÃGþšŠl„®±|„;|©>óýDô“k�;ÎtÁvn V”Ñwè8¹°“až«BK™¸ªm¸PžŸÖéå„PÏíÔ” ­GµF/&ÓW³@¤i:/bŸÀuÂ‡ Láu
ÓQJ©G}±ÅXvò‘�“Ád2ã¿+Üó{=]QLzK/F™ÆaŒà˜À æ7O`1¼õ�3àÞfR�æePvÎ3r°i�™'ôÌsø šf-Š-T´Ê”]#¬¼§‘ümq³(ºÄJ„a¹çÉ?ñéÃ}    7   ˆl–Ãa¾”Ên-jq@=p\ÊbÑ¿�þ]­¬ãqÇ#Ž> þÆ„d-:ïÅÄÃ ?÷     #!/usr/bin/env bash

set -ue

# Copyright (C) 2017-2024 MariaDB
# Copyright (C) 2010-2022 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston
# MA  02110-1335  USA.

# This is a reference script for rsync-based state snapshot transfer.

. $(dirname "$0")/wsrep_sst_common

wsrep_check_programs rsync

RSYNC_REAL_PID=0   # rsync process id
STUNNEL_REAL_PID=0 # stunnel process id

MODULE="${WSREP_SST_OPT_MODULE:-rsync_sst}"

RSYNC_PID="$DATA/$MODULE.pid"
RSYNC_CONF="$DATA/$MODULE.conf"

STUNNEL_CONF="$DATA/stunnel.conf"
STUNNEL_PID="$DATA/stunnel.pid"

MAGIC_FILE="$DATA/rsync_sst_complete"

cleanup_joiner()
{
    # Since this is invoked just after exit NNN
    local estatus=$?
    if [ $estatus -ne 0 ]; then
        wsrep_log_error "Cleanup after exit with status: $estatus"
    elif [ -z "${coords:-}" ]; then
        estatus=32
        wsrep_log_error "Failed to get current position"
    fi

    local failure=0

    [ "$(pwd)" != "$OLD_PWD" ] && cd "$OLD_PWD"

    wsrep_log_info "Joiner cleanup: rsync PID=$RSYNC_REAL_PID," \
                   "stunnel PID=$STUNNEL_REAL_PID"

    if [ -n "$STUNNEL" ]; then
        if cleanup_pid $STUNNEL_REAL_PID "$STUNNEL_PID" "$STUNNEL_CONF"; then
            if [ $RSYNC_REAL_PID -eq 0 ]; then
                if [ -r "$RSYNC_PID" ]; then
                    RSYNC_REAL_PID=$(cat "$RSYNC_PID" 2>/dev/null || :)
                    if [ -z "$RSYNC_REAL_PID" ]; then
                        RSYNC_REAL_PID=0
                    fi
                fi
            fi
        else
            wsrep_log_warning "stunnel cleanup failed."
            failure=1
        fi
    fi

    if [ $failure -eq 0 ]; then
        if cleanup_pid $RSYNC_REAL_PID "$RSYNC_PID" "$RSYNC_CONF"; then
            [ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE" || :
            [ -f "$BINLOG_TAR_FILE" ] && rm -f "$BINLOG_TAR_FILE" || :
        else
            wsrep_log_warning "rsync cleanup failed."
        fi
    fi

    if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
        wsrep_cleanup_progress_file
    fi

    [ -f "$SST_PID" ] && rm -f "$SST_PID" || :

    wsrep_log_info "Joiner cleanup done."

    exit $estatus
}

check_pid_and_port()
{
    local pid_file="$1"
    local pid=$2
    local addr="$3"
    local port="$4"

    local utils='rsync|stunnel'

    local port_info
    local final

    if ! check_port $pid "$port" "$utils"; then
        if [ $raw_socket_check -ne 0 ]; then
            return 1
        elif [ $ss_available -ne 0 -o $sockstat_available -ne 0 ]; then
            if [ $ss_available -ne 0 ]; then
                port_info=$($socket_utility $ss_opts -t "( sport = :$port )" 2>/dev/null | \
                    grep -E '[[:space:]]users:[[:space:]]?\(' | 