/[smeserver]/rpms/smeserver-yum/sme8/smeserver-yum-2.2.0.check4updates_to_smecontribs.patch
ViewVC logotype

Annotation of /rpms/smeserver-yum/sme8/smeserver-yum-2.2.0.check4updates_to_smecontribs.patch

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


Revision 1.2 - (hide annotations) (download)
Sat Feb 21 16:44:19 2015 UTC (9 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-yum-2_2_0-25_el5_sme, smeserver-yum-2_2_0-26_el5_sme, HEAD
Changes since 1.1: +29 -9 lines
* Sat Feb 21 2015 Stephane de Labrusse <stephdl@de-labrusse.fr> 2.2.0-25.sme
- Set the check update frequency of smecontribs through the server-manager
- [SME: 8858]

1 stephdl 1.2 diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs
2     --- smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs 1970-01-01 01:00:00.000000000 +0100
3     +++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/defaults/yum/CheckContribs 2015-02-21 15:20:54.982110115 +0100
4     @@ -0,0 +1 @@
5     +enabled
6     diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates
7     --- smeserver-yum-2.4.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates 1970-01-01 01:00:00.000000000 +0100
8     +++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/db/configuration/migrate/Yum-remove-check4contribsupdates 2015-02-21 16:28:14.387219668 +0100
9     @@ -0,0 +1,11 @@
10     +{
11     +#Added for bug 8855 and bug 8858
12     +#we want to remove the property check4contribsupdates
13     +
14     +
15     +my $check4contribsupdates = $DB->get_prop('yum','check4contribsupdates');
16     +
17     +if ($check4contribsupdates) {
18     + $DB->get('yum')->delete_prop('check4contribsupdates');
19     + }
20     +}
21     diff -Nur smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates smeserver-yum-2.4.0.bz8855/root/etc/e-smith/templates/etc/crontab/check4contribsupdates
22     --- smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100
23     +++ smeserver-yum-2.4.0.bz8855/root/etc/e-smith/templates/etc/crontab/check4contribsupdates 2015-02-21 15:29:17.585570439 +0100
24 stephdl 1.1 @@ -0,0 +1,25 @@
25     +{
26 stephdl 1.2 + return "\n# yum check for smecontribs updates is disabled\n" unless (($yum{status} eq 'enabled') && ($yum{CheckContribs} eq 'enabled'));
27     +
28     + my $freq = $yum{check4updates} || 'daily';
29 stephdl 1.1 +
30     + my $min;
31     + my $dom;
32     + my $dow;
33     +
34     + if ($freq eq 'weekly') {
35     + $min = 22;
36     + $dom = '*';
37     + $dow = 0;
38     + } elsif ($freq eq 'monthly') {
39     + $min = 42;
40     + $dom = 1;
41     + $dow = '*';
42     + } else {
43     + $min = 2;
44     + $dom = '*';
45     + $dow = '*';
46     + }
47     + return "$min 4 $dom * $dow root "
48     + . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4contribsupdates -m };
49     +}
50 stephdl 1.2 diff -Nur smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates smeserver-yum-2.4.0.bz8855/root/sbin/e-smith/check4contribsupdates
51     --- smeserver-yum-2.4.0/root/sbin/e-smith/check4contribsupdates 1970-01-01 01:00:00.000000000 +0100
52     +++ smeserver-yum-2.4.0.bz8855/root/sbin/e-smith/check4contribsupdates 2015-02-21 15:18:57.521125460 +0100
53 stephdl 1.1 @@ -0,0 +1,27 @@
54     +#! /bin/bash
55     +
56     +mkdir -p /tmp/check4contribsupdates.$$
57     +TMPFILE=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1
58     +TMP1=`mktemp /tmp/check4contribsupdates.$$/XXXXXXXXXX` || exit 1
59     +
60     +MAILADDR=admin-yum
61     +
62     +yum -e 0 -d 0 check-update --disablerepo=* --enablerepo=smecontribs > $TMP1
63     +if [ $? = 100 ]; then
64     + echo -e "===\n=== yum reports available updates for Contribs :\n===" >> $TMPFILE
65     + cat $TMP1 >> $TMPFILE
66     + echo -e "\n To apply all these updates, you can log on your server and run the following command :\n
67     + yum update --enablerepo=smecontribs\n" >> $TMPFILE
68     +fi
69     +
70     +if [ -s $TMPFILE ]; then
71     + if [ "$1" = "-m" ]; then
72     + mail -s "SME Server Contribs Updates available for `hostname`" $MAILADDR < $TMPFILE
73     + else
74     + echo "SME Server Contribs Updates available for `hostname`"
75     + cat $TMPFILE
76     + fi
77     +fi
78     +
79     +rm -f $TMPFILE $TMP1
80     +rm -fr /tmp/check4contribsupdates.*

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