/[smecontribs]/rpms/smeserver-affa/contribs9/smeserver-affa-fix-rise_RPMCheck_smb_diskusage.patch
ViewVC logotype

Contents of /rpms/smeserver-affa/contribs9/smeserver-affa-fix-rise_RPMCheck_smb_diskusage.patch

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


Revision 1.1 - (show annotations) (download)
Tue Apr 26 19:16:25 2016 UTC (8 years, 7 months ago) by guedel
Branch: MAIN
CVS Tags: smeserver-affa-3_2_2_3-4_el6_sme, smeserver-affa-3_2_2_3-5_el6_sme, smeserver-affa-3_2_2_3-6_el6_sme, smeserver-affa-3_2_2_3-7_el6_sme, smeserver-affa-3_2_2_3-8_el6_sme, HEAD
* Wed Mar 23 2016 Arnaud Guillaume <smeserver-affa@guedel.eu> 3.2.2.3-4.sme
- Fix use of uninitialized value $1 in concatentation (.) or string at /sbin/affa/ line 4059 [SME: 9139]
- Fix "RPMCheck" not working [SME: 9270]
- Fix Inconsistent smb.conf when samba share option set to "yes" [SME: 9298]
- Fix affa --diskusage does not umount attached storage [SME: 9147]

1 diff -ruN smeserver-affa-3.2.2.3.old/root/etc/e-smith/templates/etc/smb.conf/95Affa smeserver-affa-3.2.2.3/root/etc/e-smith/templates/etc/smb.conf/95Affa
2 --- smeserver-affa-3.2.2.3.old/root/etc/e-smith/templates/etc/smb.conf/95Affa 1970-01-01 01:00:00.000000000 +0100
3 +++ smeserver-affa-3.2.2.3/root/etc/e-smith/templates/etc/smb.conf/95Affa 2016-03-21 21:13:35.000000000 +0100
4 @@ -0,0 +1,3 @@
5 +# WARNING: don't remove the # of the following section!
6 +#[Affa-jobs]
7 +
8 diff -ruN smeserver-affa-3.2.2.3.old/root/sbin/affa smeserver-affa-3.2.2.3/root/sbin/affa
9 --- smeserver-affa-3.2.2.3.old/root/sbin/affa 2016-03-23 21:08:24.251000616 +0100
10 +++ smeserver-affa-3.2.2.3/root/sbin/affa 2016-03-23 21:52:23.773000637 +0100
11 @@ -10,7 +10,7 @@
12 # This is free software, and you are welcome to redistribute it
13 # under certain conditions; type 'affa --license' for details.
14 #----------------------------------------------------------------------
15 -my $VERSION='3.2.2.2-0';
16 +my $VERSION='3.2.2.3-4';
17 #----------------------------------------------------------------------
18
19 use strict;
20 @@ -104,7 +104,9 @@
21 sub jobsnrpe($);
22 sub logTail();
23 sub mailTest();
24 -sub mount($$$);
25 +###### ligne suivante modifiée umount diskusage - bug 9147
26 +# sub mount($$$);
27 +sub mount($$$%);
28 sub moveArchive();
29 sub moveFileorDir($$);
30 sub nrpe();
31 @@ -491,7 +493,9 @@
32 # mount root dir
33 if( $job{'AutomountDevice'} and $job{'AutomountPoint'} )
34 {
35 - mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
36 +###### ligne suivante modifiée umount diskusage - bug 9147
37 +# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
38 + mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job );
39 }
40
41 affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'};
42 @@ -934,7 +938,7 @@
43 ############################## ajout modifs
44 $sshQuiet = $job{'Debug'} eq 'yes' ? '' : '-q';
45 ############################# fin modifs
46 -#############################################################################################################################################
47 +###############################################################################################################################################
48 # get Done Dates
49 if( $jobname ) {
50 $job{'_sshOpts'}="-p $job{'sshPort'} -o CheckHostIP=no -o StrictHostKeyChecking=no -o HostKeyAlias=$jobname -o UserKnownHostsFile=/root/.ssh/knownhosts-$jobname" . ($job{'Debug'} ne 'yes' ? ' -q' : '');
51 @@ -1960,8 +1964,7 @@
52 } else {
53 # ($h = sprintf "+-%076s-+\n", '-') =~ s/0/-/g;
54 # ligne du patch Affa2 ci dessous
55 - ($h = sprintf "+-%0102s-+\n", '-') =~ s/0/-/g;
56 -
57 + ($h = sprintf "+-%0110s-+\n", '-') =~ s/0/-/g;
58 }
59 $out2 .= $h;
60 $out = $out.$out2;
61 @@ -1977,6 +1980,15 @@
62 affaErrorExit( "$txt" );
63 }
64 my %job=getJobConfig( $jobname );
65 +
66 +# automount root dir - fixing bug 9147
67 + if( $job{'AutomountDevice'} and $job{'AutomountPoint'} )
68 + {
69 + mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job );
70 + }
71 + affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'};
72 +
73 +
74 my @out = ('Archive:Count;Date;Files;Size;RootDirFilesystemAvail;RootDirFilesystemUsed;valid;TotalBytesReceived;ExecutionTime;DedupTotalFiles;DedupReplacedFiles;DedupSavedBytes;DedupExectime;DedupDate');
75 my %js;
76 my %js2;
77 @@ -2059,6 +2071,12 @@
78 . ";". $DedupDate
79 );
80 }
81 +
82 +# auto-unmount - fixing bug 9147
83 + my $dev=$job{'AutomountDevice'};
84 + my $mountPoint=$job{'AutomountPoint'};
85 + unmount($dev,$mountPoint) if $dev and $mountPoint;
86 +
87 return @out;
88 }
89
90 @@ -2217,6 +2235,14 @@
91 next if $jobname eq 'GlobalAffaConfig';
92 my %job=getJobConfig($jobname);
93
94 +# automount root dir - fixing bug 9147
95 + if( $job{'AutomountDevice'} and $job{'AutomountPoint'} )
96 + {
97 + mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job );
98 + }
99 + affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'};
100 +
101 +
102 my $rptfile=$job{'RootDir'}."/$jobname/scheduled.0/.AFFA3-REPORT";
103 my $rpt;
104 $rpt= Config::IniFiles->new( -file => $rptfile ) if( -f $rptfile );
105 @@ -2291,6 +2317,12 @@
106 my $nof = sprintf "%2d,%2d,%2d,%2d,%2d", $acnt{'scheduled'}, $acnt{'daily'}, $acnt{'weekly'}, $acnt{'monthly'}, $acnt{'yearly'};
107 push( @out, "$jobname;$status;$lastrun;$netxrun;$TotalFileSize;$avail;$used;$nof;$lock;$state;$BackupTime;$DedupTotalFiles;$DedupReplacedFiles;$DedupSavedBytes;$DedupExectime;$DedupDate");
108 }
109 +
110 + # auto-unmount - fixing bug 9147
111 + my $dev=$job{'AutomountDevice'};
112 + my $mountPoint=$job{'AutomountPoint'};
113 + unmount($dev,$mountPoint) if $dev and $mountPoint;
114 +
115 return @out;
116 }
117
118 @@ -2376,7 +2408,9 @@
119 my $mountPoint = $job{'AutomountPoint'};
120 my $mountOptions = $job{'AutomountOptions'};
121 if( $RootDir && $mountPoint && $RootDir =~ /$mountPoint/ ) {
122 - mount($dev,$mountPoint, $mountOptions) if $dev and $mountPoint;
123 +###### ligne suivante modifiée umount diskusage - bug 9147
124 +# mount($dev,$mountPoint, $mountOptions) if $dev and $mountPoint;
125 + mount($dev,$mountPoint, $mountOptions, %job) if $dev and $mountPoint;
126 ($used, $avail) = df( $RootDir) if isMounted($dev,$mountPoint);
127 unmount($dev,$mountPoint) if $dev and $mountPoint;
128 } elsif( $RootDir && -x $RootDir ) {
129 @@ -2422,8 +2456,11 @@
130 return $result;
131 }
132
133 -sub mount($$$) {
134 - (my $dev, my $AutomountPoint, my $options) = @_;
135 +###### 2 lignes suivantes modifiées umount diskusage - bug 9147
136 +# sub mount($$$) {
137 +# (my $dev, my $AutomountPoint, my $options) = @_;
138 +sub mount($$$%) {
139 + (my $dev, my $AutomountPoint, my $options, my %job) = @_;
140 $AutomountPoint =~ s/\/$//;
141 return if isMounted( $dev, $AutomountPoint );
142 File::Path::mkpath( $AutomountPoint, 0, 0700 ) if not -d $AutomountPoint;
143 @@ -2438,9 +2475,10 @@
144 }
145 }
146 $autoMounted{$AutomountPoint}=$dev if $job{'AutoUnmount'} eq 'yes';
147 +
148 }
149
150 -sub unmount($$) {
151 + sub unmount($$) {
152 (my $dev, my $AutomountPoint) = @_;
153 $AutomountPoint =~ s/\/$//;
154 return if not $autoMounted{$AutomountPoint} or $autoMounted{$AutomountPoint} ne $dev or not isMounted( $dev, $AutomountPoint );
155 @@ -2802,7 +2840,9 @@
156 my %job=getJobConfig( $jobname );
157
158 if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) {
159 - mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
160 +###### ligne suivante modifiée umount diskusage - bug 9147
161 +# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
162 + mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job );
163 }
164
165 # check if a job is running
166 @@ -2837,7 +2877,7 @@
167
168 if ($job{'SMEServer'} ne 'no')
169 {
170 - print 'SME-server= ' . $job{'SMEServer'} . "\n";
171 +#pour debbugage print 'SME-server= ' . $job{'SMEServer'} . "\n";
172 my $prerestore='SME/signal-pre-restore';
173 if ($job{'remoteHostName'} eq 'localhost')
174 {
175 @@ -2847,7 +2887,7 @@
176 {
177 execJobCommandRemote($jobname,$prerestore);
178 }
179 - print 'pre-restore: $prerestore' . "\n";
180 +#pour debbugage print 'pre-restore: $prerestore' . "\n";
181 }
182
183
184 @@ -2896,7 +2936,7 @@
185 ################################## penser à rajouter le imapIndexFilesDelete(); cf AffaV2
186
187
188 -print 'SME-server= ' . $job{'SMEServer'} . "\n";
189 +#pour debbugage print 'SME-server= ' . $job{'SMEServer'} . "\n";
190 my $postupgrade='SME/signal-post-upgrade-reboot';
191 if ($job{'remoteHostName'} eq 'localhost')
192 {
193 @@ -2906,7 +2946,7 @@
194 {
195 execJobCommandRemote($jobname,$postupgrade);
196 }
197 - print 'post-upgrade + reboot: $postupgrade' . "\n";
198 +#pour debbugage print 'post-upgrade + reboot: $postupgrade' . "\n";
199
200 }
201
202 @@ -3359,7 +3399,8 @@
203 unlink $1;
204 }
205 print FW "$_\n" if not $_ =~ /(include = \/etc\/samba\/Affa-Job|# Affa archives. Updated on)/;
206 - if( $_ =~ /^\[global\]$/i ) {
207 +# ligne d'origine - Bug 9298 - if( $_ =~ /^\[global\]$/i ) {
208 + if( $_ =~ /^#\[Affa-jobs\]$/i ) {
209 printf FW "# Affa archives. Updated on " .formatHTime(Date::Format::time2str("%Y%m%d%H%M",time())) . "\n";
210 print FW join("\n", sort keys %inc)."\n";
211 }
212 @@ -3852,7 +3893,9 @@
213
214 if( $job{'AutomountDevice'} and $job{'AutomountPoint'} )
215 {
216 - mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
217 +###### ligne suivante modifiée umount diskusage - bug 9147
218 +# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} );
219 + mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job );
220 }
221
222 # check if archive exists
223 @@ -4056,7 +4099,8 @@
224 {
225 ########### $Affa::lib::ExecCmdOutout =~ /(Total file size: [0-9]* bytes)/gm;
226 $ExecCmdOutout =~ /(Total file size: [0-9]* bytes)/gm;
227 - print "OK. $1\n";
228 +########## print "OK. $1\n"; ##### Bug 9139: valeur de $1 non définie.
229 + print "OK. \n";
230 }
231 else
232 {
233 diff -ruN smeserver-affa-3.2.2.3.old/root/sbin/e-smith/affa-rpmlist.sh smeserver-affa-3.2.2.3/root/sbin/e-smith/affa-rpmlist.sh
234 --- smeserver-affa-3.2.2.3.old/root/sbin/e-smith/affa-rpmlist.sh 2016-03-23 21:08:24.250000602 +0100
235 +++ smeserver-affa-3.2.2.3/root/sbin/e-smith/affa-rpmlist.sh 2016-03-05 17:33:16.000000000 +0100
236 @@ -4,7 +4,11 @@
237
238 # Copyright (C) 2008 Michael Weinberger, neddix Stuttgart, Germany
239 #
240 -/usr/bin/yum --noplugins list installed\
241 -|/bin/grep "installed *$"\
242 -|/bin/sed -e 's/\./ /'\
243 -|/bin/awk '{printf "%s %s\n", $1,$3}'
244 +#/usr/bin/yum --noplugins list installed\
245 +#|/bin/grep "installed *$"\
246 +#|/bin/sed -e 's/\./ /'\
247 +#|/bin/awk '{printf "%s %s\n", $1,$3}'
248 +#
249 +# Fixing bug 9270: RPMCheck for SME9
250 +/bin/rpm -qa --qf "%{NAME} %{VERSION}-%{RELEASE}\n" | sort -fu
251 +

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