Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 122252 - app-backup/rsnapshot fails when using newest gnu cp cmd
Summary: app-backup/rsnapshot fails when using newest gnu cp cmd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Bryan Østergaard (RETIRED)
URL: http://sourceforge.net/mailarchive/fo...
Whiteboard:
Keywords:
: 130347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-09 07:07 UTC by Harry Putnam
Modified: 2006-04-18 06:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cp_al patch for rsnapshot (cp_al.patch,526 bytes, patch)
2006-03-23 10:54 UTC, Tobias Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Harry Putnam 2006-02-09 07:07:04 UTC
rsnapshot-1.2.1-r1.ebuild  

Note that just now reinstalling that version I CANNOT duplicate this problem.
Maybe it was already fixed, or maybe gnu cp has been altered since I just finished an update Deep world.  I'm going to describe the problem anyway since it is a potentially very serious matter.

The problem I had was  that rsnapshot and the newest gnu cp now fail due to changes in gnu cp.  It now enforces the trailing slash to be removed when cping 2 directories.

See this report for details.
http://sourceforge.net/mailarchive/forum.php?thread_id=8988105&forum_id=41320

Here is a quote from the supplied URL:
===========================
We encountered problems with the latest version of GNU cp (GNU coreutils
5.93) and the latest version of Rsnapshot (1.2.1 source). I noticed an
important change in GNU cp between version 5.2.1 and 5.93 that causes
Rsnapshot to fail.

GNU cp 5.93 (and possibly other 5.9x) now enforce the trailing / to be
removed when copying two directories.
=====================

What makes this a serious problem is that when the cp fails and given a default installation which has no safeguards against something like this, rsnapshot reports the error as a cp failure.  But still  (mv) moves the existing backups thru a rotation 1 moved to 2 etc and 5 is deleted.  But since the copy (cp) of hourly.0 to hourly.1 fails no new data is moved into the 1 slot.  Next run another backup is deleted and the others rotated etc until all backups are gone.

This actually occured before an update deep world and again I CANNOT reproduce it but will continue testing.  Meantime someone way more skilled than I need to look at this.

Gentoo Base System version 1.12.0_pre15
Portage 2.1_pre4-r1 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.6-r2, 2.6.15-gentoo-r3 i686)
=================================================================
System uname: 2.6.15-gentoo-r3 i686 AMD Athlon(tm) 64 Processor 3400+
dev-lang/python:     2.3.5-r2, 2.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=athlon-xp -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=athlon-xp -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrored.ca/ ftp://gentoo.mirrored.ca/"
PKGDIR="/mnt/pack/gentoo/pkgiso/All"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 apm arts avi berkdb bitmap-fonts cdr crypt cups dvd eds emacs emboss encode foomaticdb fortran gcj gdbm gif gpm gstreamer gtk gtk2 hal imlib jpeg kde libg++ libwww logrotate mad mbox mikmod motif mp3 mpeg mysql ncurses nls objc ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sasl sdl smb spell ssl symlinks tcpd truetype truetype-fonts type1-fonts vorbis xinerama xml2 xmms xv zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
Comment 1 Tobias Müller 2006-03-23 10:54:44 UTC
Created attachment 82946 [details, diff]
cp_al patch for rsnapshot
Comment 2 Tobias Müller 2006-03-23 10:55:34 UTC
I created an ebuild with

        # 2006/03/23 twam: cp_al patch for newest GNU cp (coreutils), is probably fixed in rsnapshot 1.2.3
        epatch ${FILESDIR}/cp_al.patch

And everything seems to work.

Regards
  Tobias
Comment 3 Andreas Ntaflos 2006-04-12 15:18:32 UTC
Tobias, having ran into the same problem yesterday I tried to apply your patch but seem to be doing something wrong. I put the patch into /usr/portage/app-backup/rsnapshot/files and ran ebuild rsnapshot-1.2.1-r1.ebuild digest. Them I reemerged rsnapshot 1.2.1-r1. However, the scheduled backup now at 00:00 quit with the same error message about cp and deleted another of hourly backups. 

Obviously I did something wrong, but what? How do I apply such patches correctly? Help would be greatly appreciated! 

Thanks!

Andreas
Comment 4 Andreas Ntaflos 2006-04-12 15:39:42 UTC
Ok, stupid is as stupid does (but it's getting late). 

FWIW, and for future reference for stupid people like me: 

First: how could I forget I shouldn't do work in /usr/portage/app-backup/rsnapshot but in /usr/local/portage/app-backup/rsnapshot (with an appropriately set PORTDIR_OVERLAY). Second: Just as Tobias said a new ebuild /usr/local/portage/app-backup/rsnapshot/rsnapshot-1.2.1-r2 has to be created including a line like

epatch ${FILESDIR}/cp_al.patch

just after 

src_compile() {

Then the digest has to be computed by 

ebuild /usr/local/portage/app-backup/rsnapshot/rsnapshot-1.2.1-r2 digest 

Now "=rsnapshot/rsnapshot-1.2.1-r2 ~x86" has to be added to /etc/portage/package.keywords followed by a reemerge of rsnapshot. Should now be rsnapshot-1.2.1-r2 with the patch applied correctly.

Just tested it and rsnapshot works fine again.

Thanks for the patch Tobias!
Comment 5 Bryan Østergaard (RETIRED) gentoo-dev 2006-04-13 03:16:08 UTC
Fixed in rsnapshot-1.2.1-r2. Sorry about taking so long to handle this and thanks for the patch :)
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2006-04-18 06:20:22 UTC
*** Bug 130347 has been marked as a duplicate of this bug. ***