/[smeserver]/rpms/smeserver-yum/sme7/smeserver-yum-2.0.0-add-wait-timer.patch
ViewVC logotype

Annotation of /rpms/smeserver-yum/sme7/smeserver-yum-2.0.0-add-wait-timer.patch

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


Revision 1.1 - (hide annotations) (download)
Tue Mar 1 19:20:19 2011 UTC (13 years, 9 months ago) by snetram
Branch: MAIN
CVS Tags: smeserver-yum-2_0_0-15_el4_sme, smeserver-yum-2_0_0-12_el4_sme, smeserver-yum-2_0_0-17_el4_sme, smeserver-yum-2_0_0-14_el4_sme, smeserver-yum-2_0_0-13_el4_sme, smeserver-yum-2_0_0-16_el4_sme, HEAD
* Tue Mar 1 2011 Jonathan Martens <smeserver-contribs@snetram.nl> 2.0.0-12.sme
- Add random wait timer for check4updates script to distribute load on ibiblio [SME: 6489]

1 snetram 1.1 diff -up smeserver-yum-2.2.0/root/etc/e-smith/templates/etc/crontab/check4updates.add-wait-timer smeserver-yum-2.2.0/root/etc/e-smith/templates/etc/crontab/check4updates
2     --- smeserver-yum-2.2.0/root/etc/e-smith/templates/etc/crontab/check4updates.add-wait-timer 2008-10-07 16:25:45.000000000 +0200
3     +++ smeserver-yum-2.2.0/root/etc/e-smith/templates/etc/crontab/check4updates 2011-03-01 19:44:38.000000000 +0100
4     @@ -3,11 +3,23 @@
5    
6     my $freq = $yum{check4updates} || 'daily';
7    
8     + my $min;
9     + my $dom;
10     + my $dow;
11     +
12     if ($freq eq 'weekly') {
13     - return "\n22 4 * * 0 root /sbin/e-smith/check4updates -m\n";
14     + $min = 22;
15     + $dom = '*';
16     + $dow = 0;
17     } elsif ($freq eq 'monthly') {
18     - return "\n42 4 1 * * root /sbin/e-smith/check4updates -m\n";
19     + $min = 42;
20     + $dom = 1;
21     + $dow = '*';
22     } else {
23     - return "\n02 4 * * * root /sbin/e-smith/check4updates -m\n"
24     + $min = 2;
25     + $dom = '*';
26     + $dow = '*';
27     }
28     + return "$min 4 $dom * $dow root "
29     + . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4updates -m };
30     }

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