WARNING: Could not lchown() symlink "..."

Bug #340671 reported by Heiko Ettelbrück
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
rsnapshot (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: rsnapshot

Hi,

I use rsnapshot to backup some stuff to an NFS share (if that kind of backup target is relevant; exported with option "no_root_squash" to allow full access for rsnapshot, which runs as root).

I noticed that rsnapshot always returned code 2, which indicates warnings according to the man page (which were not printed to stdout although I have the default configuration with "verbose 2", which means "Print errors and warnings only" according to the default rsnapshot.conf). So I raised the value for "verbose" to 3 and got the following warning messages on stdout:

WARNING: Could not lchown() symlink "/mnt/backup/.snapshots/.sync/james/etc/fonts/conf.d/30-urw-aliases.conf" (same for lots of other files = symlinks)

Searching the web about this, I found e.g. http://osdir.com/ml/sysutils.backup.rsnapshot.general/2006-08/msg00089.html which basically tells me to install the "Lchown" Perl module (manually, via CPAN). As I didn't find any Ubuntu 8.10 package with that module (I there's still one, please tell me), I installed it manually (after "apt-get install libyaml-perl make gcc" to install the required tools).

Running rsnapshot again, I no longer get these warnings, so I guess this really fixed them.

Could you please take a look and check what could be done here to make "rsnapshot" work without these warnings? Is the "Lchown" Perl module available in Intrepid? If yes, what do you think about adding a dependency to that package from rsnapshot? If not, would it be possible to either make it available somehow (probably you wouldn't do it yourself, but ask someone to take that part) or document it somewhere (where? I don't have that much experience with the "Ubuntu way" here by now, still learning...)?

Thanks and best regards
Heiko

Tags: patch
Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

Perl lchown package in Jaunty: liblchown-perl
Installing this package stopped the rsnapshot lchown-warnings for me.
It should probably be a dependency of the rsnapshot package.

Perhaps a better alternative than to use rsnapshot's internal copy-function is to use the cp binary.
From /etc/rsnapshot.conf:
---------------------------------------------------------------------------
# LINUX USERS: Be sure to uncomment "cmd_cp". This gives you extra features.
# EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
#
# See the README file or the man page for more details.
#
cmd_cp /bin/cp
---------------------------------------------------------------------------

And if you enable link_dest, rsnapshot does not seem to use any copy command at all (rsync does the job):
---------------------------------------------------------------------------
# If your version of rsync supports --link-dest, consider enable this.
# This is the best way to support special files (FIFOs, etc) cross-platform.
# The default is 0 (off).
#
link_dest 1
---------------------------------------------------------------------------

These two alternatives do not require the lchown perl module.

Revision history for this message
Jorgen Austvik (jorgen-austvik) wrote :

I was just about to file the same bug, and can confirm Håkon's findings re liblchown-perl, and think adding a dependency would be good.

I have also updated my config file based on Håkon's suggestions above.

Revision history for this message
Derek Simkowiak (ubuntu-cool-st) wrote :

Me too. (Add the liblchown-perl dependency please.)

Revision history for this message
Mark Foster (fostermarkd) wrote :

Please add depends for liblchown-perl, or adjust the rsnapshot.conf defaults to link_dest 1 and cmd_cp /bin/cp as described earlier.

Revision history for this message
Xavier Robin (jti-533g) wrote :

Quite surprisingly it affects only hourly backups. My daily and weekly backups run without warnings.

Revision history for this message
Heiko Ettelbrück (hbrucky) wrote :

Maybe that's just because only "hourly" (in your configuration) really backs up files from your "productive" machine/volume, while the "higher" backup levels like "daily" and "weekly" just clone the hard links from the "parent" level (e.g. "daily.0" is a clone of "hourly.0").

See the man page of rsnapshot:

"Intervals must be specified in the config file in order, from most frequent to least frequent. The
first entry is the one which will be synced with the backup points. The subsequent intervals (e.g.,
daily, weekly, etc) simply rotate, with each higher interval pulling from the one below it for its
.0 directory."

Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

Xavier, Heiko: I think the other backups than hourly just involve folder renaming. That's why they won't have any lchown problems.

From my /var/log/rsnapshot.log:
[17/Nov/2010:03:30:01] /usr/bin/rsnapshot daily: started
[17/Nov/2010:03:30:01] echo 11101 > /var/run/rsnapshot.pid
[17/Nov/2010:03:30:01] /bin/rm -rf /backup/rsnapshot/rsnapshot/daily.6/
[17/Nov/2010:03:32:50] mv /backup/rsnapshot/rsnapshot/daily.5/ /backup/rsnapshot/rsnapshot/daily.6/
[17/Nov/2010:03:32:50] mv /backup/rsnapshot/rsnapshot/daily.4/ /backup/rsnapshot/rsnapshot/daily.5/
[17/Nov/2010:03:32:51] mv /backup/rsnapshot/rsnapshot/daily.3/ /backup/rsnapshot/rsnapshot/daily.4/
[17/Nov/2010:03:32:51] mv /backup/rsnapshot/rsnapshot/daily.2/ /backup/rsnapshot/rsnapshot/daily.3/
[17/Nov/2010:03:32:51] mv /backup/rsnapshot/rsnapshot/daily.1/ /backup/rsnapshot/rsnapshot/daily.2/
[17/Nov/2010:03:32:51] mv /backup/rsnapshot/rsnapshot/daily.0/ /backup/rsnapshot/rsnapshot/daily.1/
[17/Nov/2010:03:32:51] mv /backup/rsnapshot/rsnapshot/hourly.5/ /backup/rsnapshot/rsnapshot/daily.0/
[17/Nov/2010:03:32:51] rm -f /var/run/rsnapshot.pid
[17/Nov/2010:03:32:51] /usr/bin/rsnapshot daily: completed successfully

Revision history for this message
Xavier Robin (jti-533g) wrote :

It is better to enable the cmd_cp line. The conf file clearly states it is better enabling it than installing this perl module.

I think this patch for rsnapshot.conf.default.in would fix it.

tags: added: patch
Revision history for this message
Andreas Olsson (andol) wrote :

Marking as resolved, as the rsnapshot packages does depend on liblchown-perl as of rsnapshot 1.3.1-1 (maverick).

Regarding enabling cmd_cp by default, I would say that that is part of a more general approach to rsnapshot.conf, such as covered by bug #278998. I have contacted the Debian rsnapshot maintainer to get a feel for his opinion regarding configuration defaults etc.

Changed in rsnapshot (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.