diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-11-19 17:48:36 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-11-19 17:48:36 +0100 |
commit | 7f19330c595e3183d079fe2c18eecc74740e8f83 (patch) | |
tree | 8b853976cd14d96d5415757be525133b32be0c93 /scripts/wsrep_sst_rsync.sh | |
parent | 4046ed12bcddfd831c510b022cb7af224be9457b (diff) | |
parent | f4421c893b50f05078f14d33c47d21f52f59f8a7 (diff) | |
download | mariadb-git-7f19330c595e3183d079fe2c18eecc74740e8f83.tar.gz |
Merge branch 'github/10.0-galera' into 10.1
Diffstat (limited to 'scripts/wsrep_sst_rsync.sh')
-rw-r--r-- | scripts/wsrep_sst_rsync.sh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index ee63fe04fe7..a93ab940593 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -18,8 +18,10 @@ # This is a reference script for rsync-based state snapshot tansfer -RSYNC_PID= -RSYNC_CONF= +RSYNC_PID= # rsync pid file +RSYNC_CONF= # rsync configuration file +RSYNC_REAL_PID= # rsync process id + OS=$(uname) [ "$OS" == "Darwin" ] && export -n LD_LIBRARY_PATH @@ -32,10 +34,12 @@ wsrep_check_programs rsync cleanup_joiner() { - wsrep_log_info "Joiner cleanup." - local PID=$(cat "$RSYNC_PID" 2>/dev/null || echo 0) - [ "0" != "$PID" ] && kill $PID && sleep 0.5 && kill -9 $PID >/dev/null 2>&1 \ - || : + wsrep_log_info "Joiner cleanup. rsync PID: $RSYNC_REAL_PID" + [ "0" != "$RSYNC_REAL_PID" ] && \ + kill $RSYNC_REAL_PID && \ + sleep 0.5 && \ + kill -9 $RSYNC_REAL_PID >/dev/null 2>&1 || \ + : rm -rf "$RSYNC_CONF" rm -rf "$MAGIC_FILE" rm -rf "$RSYNC_PID" @@ -45,6 +49,7 @@ cleanup_joiner() fi } +# Check whether rsync process is still running. check_pid() { local pid_file=$1 |