tags 660372 moreinfo
thanks

Hi,

Le samedi 18 février 2012 à 18:53 +0100, Mike Gabriel a écrit :
> Package: rsnapshot
> Version: 1.3.1-1
> Severity: normal
> Tags: squeeze
> 
> With rsnapshot from lenny it was able to copy backups to a mounted USB hard 
> disk
> and unmount the USB disk after rsnapshot had finished. For the unmounting I 
> used
> the cmd_postexec configuration parameter.
> 
> With rsnapshot from squeeze this is not possible anymore. rsnapshot complains 
> with
> ,,Device or resource busy'' (meaning: the USB disk cannot be unmounted because
> rsnapshot has its current working directory within the snapshot root 
> somewhere).
> 
> With this issue report I would like to provide a patch (against rsnapshot in 
> squeeze)
> that might solve the problem. (,,might'' means here: the problem occurrs at a 
> customer's
> site where I cannot test the patch ATM, but it is very likely that the patch 
> fixes the
> reported issue).

I'm not sure the problem are cmd_{pre,post}exec commands, the following
tests work well in a squeeze chroot test environment (i only use
rsnapshot to backup to local storage):

#### fake usb device disk with ext3 fs mounted on loopback

$ dd if=/dev/zero of=/tmp/usb_fake_disk bs=1M count=128
$ sudo mkfs -t ext3 /tmp/usb_fake_disk
$ sudo mount -o loop /tmp/usb_fake_disk /mnt/ && ls /mnt \
  && sudo umount /mnt/

#### minimal rsnapshot.conf

$ egrep -v '^($|#)' /etc/rsnapshot.conf 
config_version  1.2
snapshot_root   /mnt/
cmd_rm          /bin/rm
cmd_rsync       /usr/bin/rsync
cmd_logger      /usr/bin/logger
cmd_preexec     /bin/mount -o loop /tmp/usb_fake_disk /mnt/
cmd_postexec    /bin/umount /mnt/
interval        hourly  6
interval        daily   7
interval        weekly  4
verbose         2
loglevel        3
lockfile        /var/run/rsnapshot.pid
backup  /etc/           localhost/

#### launch a job to validate

$ sudo rsnapshot -v hourly
echo 19163 > /var/run/rsnapshot.pid 
/bin/mount -o loop /tmp/usb_fake_disk /mnt/ 
mkdir -m 0755 -p /mnt/hourly.0/ 
/usr/bin/rsync -a --delete --numeric-ids --relative
--delete-excluded /etc \
    /mnt/hourly.0/localhost/ 
touch /mnt/hourly.0/ 
/bin/umount /mnt/ 
rm -f /var/run/rsnapshot.pid 

$ sudo mount -o loop /tmp/usb_fake_disk /mnt/ \
  && ls /mnt/hourly.0/localhost/
etc


Can you check the issue by running the rsnapshot cron jobs with the "-v"
flag and redirect stderr to a logfile to verify that the problem is not
the usb disk itself (to long to umount, etc.) or its usage (use lsof or
fuser to verify that no other task use the mountpoint, etc.) ?

It would be great to have information about this issue, to definitively
eliminate or not cmd_{pre,post}exec behavior (and maybe great to
validate your patch too).

Thanks.

> 
> The patch will be send with a follow-up mail.
> 
> -- System Information:
> Debian Release: 6.0.4
>   APT prefers stable
>   APT policy: (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
> Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> 
> Versions of packages rsnapshot depends on:
> ii  liblchown-perl         1.01-1            Perl interface to the lchown() 
> sys
> ii  logrotate              3.7.8-6           Log rotation utility
> ii  perl                   5.10.1-17squeeze3 Larry Wall's Practical 
> Extraction 
> ii  rsync                  3.0.7-2           fast remote file copy program 
> (lik
> 
> Versions of packages rsnapshot recommends:
> ii  openssh-client        1:5.5p1-6+squeeze1 secure shell (SSH) client, for 
> sec
> 
> rsnapshot suggests no packages.
> 
> -- no debconf information
> 
> 
> 

-- 
Guillaume Delacour <g...@iroqwa.org>

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

Reply via email to