mirror of https://github.com/jimsalterjrs/sanoid
some FreeBSD related fixes
This commit is contained in:
parent
d96f2d9c92
commit
9791094816
3
syncoid
3
syncoid
|
|
@ -773,7 +773,8 @@ sub syncdataset {
|
|||
};
|
||||
|
||||
$exit == 0 or do {
|
||||
if (!$resume && $stdout =~ /\Qcontains partially-complete state\E/) {
|
||||
# FreeBSD reports "dataset is busy" instead of "contains partially-complete state"
|
||||
if (!$resume && ($stdout =~ /\Qcontains partially-complete state\E/ || $stdout =~ /\Qdataset is busy\E/)) {
|
||||
if (!$quiet) { print "WARN: resetting partially receive state\n"; }
|
||||
resetreceivestate($targethost,$targetfs,$targetisroot);
|
||||
system("$synccmd") == 0 or do {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function cleanUp {
|
|||
# export pool in any case
|
||||
trap cleanUp EXIT
|
||||
|
||||
zfs create "${POOL_NAME}"/src -o mountpoint="${MOUNT_TARGET}"
|
||||
zfs create -o mountpoint="${MOUNT_TARGET}" "${POOL_NAME}"/src
|
||||
../../../syncoid --debug --compress=none "${POOL_NAME}"/src "${POOL_NAME}"/dst
|
||||
|
||||
dd if=/dev/urandom of="${MOUNT_TARGET}"/big_file bs=1M count=200
|
||||
|
|
@ -31,19 +31,16 @@ dd if=/dev/urandom of="${MOUNT_TARGET}"/big_file bs=1M count=200
|
|||
../../../syncoid --debug --compress=none --source-bwlimit=2m "${POOL_NAME}"/src "${POOL_NAME}"/dst &
|
||||
syncoid_pid=$!
|
||||
sleep 5
|
||||
list_descendants ()
|
||||
{
|
||||
local children=$(ps -o pid= --ppid "$1")
|
||||
|
||||
for pid in $children
|
||||
function getcpid() {
|
||||
cpids=$(pgrep -P "$1"|xargs)
|
||||
for cpid in $cpids;
|
||||
do
|
||||
list_descendants "$pid"
|
||||
echo "$cpid"
|
||||
getcpid "$cpid"
|
||||
done
|
||||
|
||||
echo "$children"
|
||||
}
|
||||
|
||||
kill $(list_descendants $$) || true
|
||||
kill $(getcpid $$) || true
|
||||
wait
|
||||
sleep 1
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ function cleanUp {
|
|||
# export pool in any case
|
||||
trap cleanUp EXIT
|
||||
|
||||
zfs create "${POOL_NAME}"/src -o mountpoint="${MOUNT_TARGET}"
|
||||
zfs create -o mountpoint="${MOUNT_TARGET}" "${POOL_NAME}"/src
|
||||
../../../syncoid --debug --compress=none "${POOL_NAME}"/src "${POOL_NAME}"/dst
|
||||
|
||||
dd if=/dev/urandom of="${MOUNT_TARGET}"/big_file bs=1M count=200
|
||||
|
|
@ -32,19 +32,16 @@ zfs snapshot "${POOL_NAME}"/src@big
|
|||
../../../syncoid --debug --no-sync-snap --compress=none --source-bwlimit=2m "${POOL_NAME}"/src "${POOL_NAME}"/dst &
|
||||
syncoid_pid=$!
|
||||
sleep 5
|
||||
list_descendants ()
|
||||
{
|
||||
local children=$(ps -o pid= --ppid "$1")
|
||||
|
||||
for pid in $children
|
||||
function getcpid() {
|
||||
cpids=$(pgrep -P "$1"|xargs)
|
||||
for cpid in $cpids;
|
||||
do
|
||||
list_descendants "$pid"
|
||||
echo "$cpid"
|
||||
getcpid "$cpid"
|
||||
done
|
||||
|
||||
echo "$children"
|
||||
}
|
||||
|
||||
kill $(list_descendants $$) || true
|
||||
kill $(getcpid $$) || true
|
||||
wait
|
||||
sleep 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue