From c4349bc94527ccc47e2ba71a4b6e3fa1b6e0330f Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 14 Jun 2023 13:50:04 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_osync.sh | 15 +++++++++++++-- install.sh | 23 +++++++++++++++++------ osync.sh | 15 +++++++++++++-- 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 0dc0915..2136dd7 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -42,8 +42,8 @@ CONFIG_FILE_REVISION_REQUIRED=1.3.0 # UnlockReplicas yes #__WITH_PARANOIA_DEBUG # CleanUp no #__WITH_PARANOIA_DEBUG -_OFUNCTIONS_VERSION=2.5.0 -_OFUNCTIONS_BUILD=2023061001 +_OFUNCTIONS_VERSION=2.5.1 +_OFUNCTIONS_BUILD=2023061401 _OFUNCTIONS_BOOTSTRAP=true if ! type "$BASH" > /dev/null; then @@ -2254,6 +2254,16 @@ function InitRemoteOSDependingSettings { ## Set rsync default arguments (complete with -r or -d depending on recursivity later) RSYNC_DEFAULT_ARGS="-ltD -8" + + ## NPF-MOD: Regarding #242, we need to add --old-args if rsync > 3.2.3 + #rsync_version=$("${RSYNC_EXECUTABLE}" --version 2>/dev/null| head -1 | awk '{print $3}') + #if [ $(VerComp $rsync_version 3.2.3) -eq 1 ]; then + # RSYNC_DEFAULT_ARGS="$RSYNC_DEFAULT_ARGS --old-args" + #fi + # NPF-MOD: Strangely enough, also happens on RHEL7 rsync 3.1.1 + # Let's resolve this easier + RSYNC_OLD_ARGS=1 + if [ "$_DRYRUN" == true ]; then RSYNC_DRY_ARG="-n" DRY_WARNING="/!\ DRY RUN " @@ -2261,6 +2271,7 @@ function InitRemoteOSDependingSettings { RSYNC_DRY_ARG="" fi + RSYNC_ATTR_ARGS="" if [ "$PRESERVE_PERMISSIONS" != false ]; then RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -p" diff --git a/install.sh b/install.sh index 803889a..f6a3556 100755 --- a/install.sh +++ b/install.sh @@ -10,15 +10,15 @@ PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BATCH=$PROGRAM"-batch.sh" SSH_FILTER="ssh_filter.sh" -SCRIPT_BUILD=2020112901 +SCRIPT_BUILD=2023061101 INSTANCE_ID="installer-$SCRIPT_BUILD" ## osync / obackup / pmocr / zsnap install script ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8, 10 and 11 ## Please adapt this to fit your distro needs -_OFUNCTIONS_VERSION=2.5.0 -_OFUNCTIONS_BUILD=2023061001 +_OFUNCTIONS_VERSION=2.5.1 +_OFUNCTIONS_BUILD=2023061401 _OFUNCTIONS_BOOTSTRAP=true if ! type "$BASH" > /dev/null; then @@ -655,15 +655,26 @@ function SetLocalOSSettings { } function GetInit { + init="none" if [ -f /sbin/openrc-run ]; then init="openrc" Logger "Detected openrc." "NOTICE" + elif [ -f /usr/lib/systemd/systemd ]; then + init="systemd" + Logger "Detected systemd." "NOTICE" elif [ -f /sbin/init ]; then - if file /sbin/init | grep systemd > /dev/null; then - init="systemd" - Logger "Detected systemd." "NOTICE" + if type -p file > /dev/null 2>&1; then + if file /sbin/init | grep systemd > /dev/null; then + init="systemd" + Logger "Detected systemd." "NOTICE" + else + init="initV" + fi else init="initV" + fi + + if [ $init == "initV" ]; then Logger "Detected initV." "NOTICE" fi else diff --git a/osync.sh b/osync.sh index cf1a852..ca042ed 100755 --- a/osync.sh +++ b/osync.sh @@ -13,8 +13,8 @@ IS_STABLE=true CONFIG_FILE_REVISION_REQUIRED=1.3.0 -_OFUNCTIONS_VERSION=2.5.0 -_OFUNCTIONS_BUILD=2023061001 +_OFUNCTIONS_VERSION=2.5.1 +_OFUNCTIONS_BUILD=2023061401 _OFUNCTIONS_BOOTSTRAP=true if ! type "$BASH" > /dev/null; then @@ -2104,6 +2104,16 @@ function InitRemoteOSDependingSettings { ## Set rsync default arguments (complete with -r or -d depending on recursivity later) RSYNC_DEFAULT_ARGS="-ltD -8" + + ## NPF-MOD: Regarding #242, we need to add --old-args if rsync > 3.2.3 + #rsync_version=$("${RSYNC_EXECUTABLE}" --version 2>/dev/null| head -1 | awk '{print $3}') + #if [ $(VerComp $rsync_version 3.2.3) -eq 1 ]; then + # RSYNC_DEFAULT_ARGS="$RSYNC_DEFAULT_ARGS --old-args" + #fi + # NPF-MOD: Strangely enough, also happens on RHEL7 rsync 3.1.1 + # Let's resolve this easier + RSYNC_OLD_ARGS=1 + if [ "$_DRYRUN" == true ]; then RSYNC_DRY_ARG="-n" DRY_WARNING="/!\ DRY RUN " @@ -2111,6 +2121,7 @@ function InitRemoteOSDependingSettings { RSYNC_DRY_ARG="" fi + RSYNC_ATTR_ARGS="" if [ "$PRESERVE_PERMISSIONS" != false ]; then RSYNC_ATTR_ARGS=$RSYNC_ATTR_ARGS" -p"