[Rear-users] stopping rear ends with empty usb disk

Schlomo Schapiro schlomo at schapiro.org
Tue Jul 12 17:16:00 CEST 2011


Hi,

Am 12.07.2011 16:58, schrieb upen:
>> Now the Question, what is the right way to interrupt rear?
> 
> I second this issue. In my case I saw exactly similar behavior where
> backups for 2 servers in 2 directories on the same NFS share got
> deleted when CTRL-c was used on a third server in the middle of 'rear
> mkbackup' process. Lesson I learned from this is use unique NFS shares
> for each server.

AFAIKT the main issue is running the ExitTasks upon Ctrl-C. The idea
here is to first kill all subprocesses, then umount the netfs share and
only then remove the work area. Indeed, previously rear would remove the
work area including a mounted netfs share, bit me too once (on my test
environment). That was when I added the ExitTasks stuff.

In 1.11.0 we already have the code for this in lib/_input*.sh:

# do all exit tasks
DoExitTasks() {
    Log "Running exit tasks."
    # kill all running jobs
    JOBS=( $(jobs -p) )
    if test "$JOBS" ; then
                Log "The following jobs are still active:"
                jobs -l 1>&2
        kill -9 "${JOBS[@]}" &>/dev/null
        sleep 1 # allow system to clean up after killed jobs
    fi
    for task in "${EXIT_TASKS[@]}" ; do
        Debug "Exit task '$task'"
        eval "$task"
    done
}

Would be nice to know the exact case when this does not work as expected
so that we can fix it. After writing this I did some tests and it seemed
to work.

> 
> Other issue I noticed with CTRL-c is it doesn't kill the rear process
> completely, I found 'rear mkbackup ' process was still  being shown in
> ps output as well as 'tar' as a result of this the
> /tmp/rear.xxxxx/netfs also remained mounted.

Should not happen, if you can give us a reproducible way to see this
then we have a good chance to fix it. Otherwise you will have to explore
with pstree -paul etc. what is going on.

IMHO Ctrl-C is the correct way to abort ReaR and ReaR should handle this
properly.

Regards,
Schlomo




More information about the rear-users mailing list