This patch is against rsnapshot-1.2.1-1.noarch.rpm.
The first two chunks are because the locking code has a race condition.
I've somehow managed to have two rsnapshots starting at exactly the same
time each day from cron, and what happens is both check for the existence
of the lock file, find it doesn't exist, write their pid in the lock file
(one will overwrite the other) and then continue on their merry way.
This leads to ugly results (like having two rsnapshots both trying to
delete the same old snapshot directory and getting lots of errors).
The last chunk is because I've seen the "Did you copy ... yet?"
message when its not appropriate (I did copy rsnapshot.conf.default,
but there was some other problem with the config file).
--- /usr/bin/rsnapshot 2005-04-10 08:59:25.000000000 +1000
+++ /usr/bin/rsnapshot.new 2005-07-12 11:24:12.000000000 +1000
< at > < at > -36,6 +36,7 < at > < at >
use File::Path; # mkpath(), rmtree()
use File::stat; # stat(), lstat()
use POSIX qw(locale_h); # setlocale()
+use Fcntl; # sysopen()
########################################
### DECLARE GLOBAL VARIABLES ###
< at > < at > -1904,7 +1905,7 < at > < at >
print_cmd("echo $$ > $lockfile");
if (0 == $test) {
- my $result = open(LOCKFILE, "> $lockfile");
+ my $result = sysopen(LOCKFILE, $lockfile, O_WRONLY | O_EXCL | O_CREAT);
if (!defined($result)) {
print_err ("Could not write lockfile $lockfile", 1);
syslog_err("Could not write lockfile $lockfile");
< at > < at > -2138,7 +2139,7 < at > < at >
}
# if we have the default config from the install, remind the user to create the real config
- if (-e "$config_file.default") {
+ if (-e "$config_file.default" && ! -e "$config_file" ) {
print STDERR "Did you copy $config_file.default to $config_file yet?\n";
}
___________________________________________________________________________
David Keegel <djk < at > cybersource.com.au> http://www.cyber.com.au/users/djk/
Cybersource P/L: Linux/Unix Systems Administration Consulting/Contracting
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
