/[smeserver]/rpms/e-smith-backup/sme7/e-smith-backup-2.0.0-CheckDarReturnCode.patch
ViewVC logotype

Contents of /rpms/e-smith-backup/sme7/e-smith-backup-2.0.0-CheckDarReturnCode.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Mar 11 16:13:03 2011 UTC (13 years, 2 months ago) by wellsi
Branch: MAIN
CVS Tags: e-smith-backup-2_0_0-36_el4_sme, e-smith-backup-2_0_0-38_el4_sme, e-smith-backup-2_0_0-33_el4_sme, e-smith-backup-2_0_0-35_el4_sme, e-smith-backup-2_0_0-32_el4_sme, e-smith-backup-2_0_0-37_el4_sme, e-smith-backup-2_0_0-34_el4_sme, HEAD
Backup to Workstation does not handle full remote disc gracefully, by Filippo Carletti [SME: 5688]

1 diff -ruN e-smith-backup-2.0.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.0.0/root/etc/e-smith/events/actions/workstation-backup-dar
2 --- e-smith-backup-2.0.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2011-03-11 14:48:13.000000000 +0000
3 +++ e-smith-backup-2.0.0/root/etc/e-smith/events/actions/workstation-backup-dar 2011-03-11 14:53:02.000000000 +0000
4 @@ -27,6 +27,7 @@
5 use Time::localtime;
6 use File::Copy;
7 use File::Path;
8 +use POSIX ":sys_wait_h";
9 use esmith::ConfigDB;
10
11 sub ldie;
12 @@ -265,7 +266,11 @@
13
14 # launching dar backup
15
16 -run_backup();
17 +my $rc = run_backup();
18 +if ($rc != 0)
19 +{
20 + ldie("Error while running dar: $rc");
21 +}
22
23 if ($incnum == 0)
24 {
25 @@ -340,7 +345,7 @@
26 $tick--;
27 exit unless (kill(0, $darpid));
28 }
29 -
30 +
31 if (kill(0, $darpid)) {
32 while (kill('QUIT', $darpid) != 1) {
33 warn "Failed to stop $darpid dar process\n";
34 @@ -365,10 +370,9 @@
35 if ($pid) {
36 $killerpid = start_dar_killer($pid, $timeout); }
37 $data = do { local($/); <INPUT> };
38 - close(INPUT);
39 };
40 $report .= $data;
41 -
42 +
43 if ($killerpid && kill(0, $killerpid)) {
44 while (kill(9, $killerpid) != 1) {
45 warn "Failed to kill $killerpid killer process\n";
46 @@ -377,5 +381,8 @@
47 waitpid($killerpid, 0);
48 }
49
50 - return;
51 + waitpid($pid, 0);
52 + my $code = WEXITSTATUS($?);
53 + close(INPUT);
54 + return $code;
55 }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed