/[smeserver]/rpms/smeserver-yum/sme10/smeserver-yum-2.6.0.bz10690.autoinstall.patch
ViewVC logotype

Contents of /rpms/smeserver-yum/sme10/smeserver-yum-2.6.0.bz10690.autoinstall.patch

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


Revision 1.2 - (show annotations) (download)
Mon Jul 11 15:20:32 2022 UTC (22 months, 1 week ago) by jpp
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
bump version

1 diff -Nur smeserver-yum-2.6.0.old/createlinks smeserver-yum-2.6.0/createlinks
2 --- smeserver-yum-2.6.0.old/createlinks 2016-02-05 18:19:56.000000000 -0500
3 +++ smeserver-yum-2.6.0/createlinks 2019-12-08 16:32:13.671000000 -0500
4 @@ -5,7 +5,7 @@
5 use File::Path;
6
7 foreach my $file (qw(/etc/yum.conf /etc/yum/protected.d/smeserver.conf
8 - /etc/yum.smerepos.d/sme-base.repo))
9 + /etc/yum.smerepos.d/sme-base.repo /etc/yum/yum-cron.conf))
10 {
11 templates2events($file, qw(yum-modify bootstrap-console-save));
12 }
13 @@ -19,7 +19,9 @@
14 event_link("navigation-conf", "yum-$_", "80");
15 }
16
17 -for ( qw(install remove update modify) )
18 +# yum-update-dbs is launched by smeserver yum plugin,
19 +# it isnot needed anymore in install remove and update events
20 +for ( qw(modify) )
21 {
22 event_link("yum-update-dbs", "yum-$_", "90");
23 }
24 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/yum smeserver-yum-2.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/yum
25 --- smeserver-yum-2.6.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/yum 2019-12-06 17:36:57.161000000 -0500
26 +++ smeserver-yum-2.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/yum 2019-12-08 15:32:21.773645948 -0500
27 @@ -20,6 +20,10 @@
28 <base>LABEL_YUM_AUTOINSTALLUPDATES</base>
29 <trans>Automatically install updates</trans>
30 </entry>
31 + <entry>
32 + <base>LABEL_YUM_AUTOINSTALLUPDATES_DESCRIPTION</base>
33 + <trans>If enabled this will take precedence over the simple check for updates notification and predownload features. Instead it will install the available updates from enabled repositories. For more information refer to yum and yum-cron manual page.</trans>
34 + </entry>
35
36 <entry>
37 <base>LABEL_YUM_PACKAGEFUNCTIONS</base>
38 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly
39 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly 2019-12-06 17:36:57.161000000 -0500
40 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly 1969-12-31 19:00:00.000000000 -0500
41 @@ -1,11 +0,0 @@
42 -{
43 - return "\n# yum status is disabled\n" unless $yum{status} eq 'enabled';
44 -
45 - my $downloadonly = $yum{DownloadOnly} || 'disabled';
46 -
47 - return "\n# Yum download only is disabled" if ($downloadonly eq 'disabled');
48 - my $hour = $yum{DownloadOnlyHour} || '4';
49 - return "2 $hour * * * root "
50 - . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/yumdownloadonly -m };
51 -
52 -}
53 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands
54 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands 1969-12-31 19:00:00.000000000 -0500
55 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands 2019-12-08 16:26:45.745528729 -0500
56 @@ -0,0 +1,42 @@
57 +{
58 + our $AutoInstallUpdates = $yum{AutoInstallUpdates} || 'disabled';
59 + $AutoInstallUpdates = ( $AutoInstallUpdates eq "disabled") ? "no" : "yes";
60 + our $downloadonly = $yum{DownloadOnly} || 'disabled';
61 + $downloadonly = ($downloadonly eq "disabled") ? "no" : "yes";
62 + our $check = $yum{check4updates} || 'daily';
63 + $check = ($check eq "disabled") ? "no" : "yes";
64 + $check = ($downloadonly eq "yes" || $AutoInstallUpdates eq "yes" ) ? "yes" : $check;
65 + $OUT = "";
66 +}
67 +[commands]
68 +# What kind of update to use:
69 +# default = yum upgrade
70 +# security = yum --security upgrade
71 +# security-severity:Critical = yum --sec-severity=Critical upgrade
72 +# minimal = yum --bugfix update-minimal
73 +# minimal-security = yum --security update-minimal
74 +# minimal-security-severity:Critical = --sec-severity=Critical update-minimal
75 +# Note: CentOS and Koozali SME Server do not provide the necessary information
76 +# in order to have security and minimal upgrade functionality.
77 +update_cmd = default
78 +
79 +# Whether a message should be emitted when updates are available,
80 +# were downloaded, or applied.
81 +update_messages = { $check || "yes" }
82 +
83 +# Whether updates should be downloaded when they are available.
84 +download_updates = { $downloadonly || "no" }
85 +
86 +# Whether updates should be applied when they are available. Note
87 +# that download_updates must also be yes for the update to be applied.
88 +apply_updates = { $AutoInstallUpdates }
89 +
90 +# Maximum amout of time to randomly sleep, in minutes. The program
91 +# will sleep for a random amount of time between 0 and random_sleep
92 +# minutes before running. This is useful for e.g. staggering the
93 +# times that multiple systems will access update servers. If
94 +# random_sleep is 0 or negative, the program will run immediately.
95 +# 6*60 = 360
96 +random_sleep = { $yum{sleep} || '0' }
97 +
98 +
99 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters
100 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters 1969-12-31 19:00:00.000000000 -0500
101 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters 2019-12-08 16:17:02.599046123 -0500
102 @@ -0,0 +1,18 @@
103 +[emitters]
104 +# Name to use for this system in messages that are emitted. If
105 +# system_name is None, the hostname will be used.
106 +system_name = { $SystemName . "." . $DomainName || 'None' }
107 +
108 +# How to send messages. Valid options are stdio and email. If
109 +# emit_via includes stdio, messages will be sent to stdout; this is useful
110 +# to have cron send the messages. If emit_via includes email, this
111 +# program will send email itself according to the configured options.
112 +# If emit_via is None or left blank, no messages will be sent.
113 +emit_via = stdio
114 +
115 +# The width, in characters, that messages that are emitted should be
116 +# formatted to.
117 +output_width = { $yum{output_width} || '100' }
118 +
119 +
120 +
121 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email
122 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email 1969-12-31 19:00:00.000000000 -0500
123 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email 2019-12-08 16:17:28.659737216 -0500
124 @@ -0,0 +1,12 @@
125 +[email]
126 +# The address to send email messages from.
127 +# NOTE: 'localhost' will be replaced with the value of system_name.
128 +email_from = { 'root@' . $DomainName }
129 +
130 +# List of addresses to send messages to.
131 +email_to = { $yum{ReportEmail} || 'admin@' . $DomainName }
132 +
133 +# Name of the host to connect to to send email messages.
134 +email_host = localhost
135 +
136 +
137 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups
138 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups 1969-12-31 19:00:00.000000000 -0500
139 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups 2019-12-08 16:13:59.923198616 -0500
140 @@ -0,0 +1,9 @@
141 +[groups]
142 +# NOTE: This only works when group_command != objects, which is now the default
143 +# List of groups to update
144 +group_list = None
145 +
146 +# The types of group packages to install
147 +group_package_types = mandatory, core, default
148 +
149 +
150 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base
151 --- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base 1969-12-31 19:00:00.000000000 -0500
152 +++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base 2019-12-08 16:15:32.440654375 -0500
153 @@ -0,0 +1,25 @@
154 +[base]
155 +# This section overrides yum.conf
156 +
157 +# Use this to filter Yum core messages
158 +# -4: critical
159 +# -3: critical+errors
160 +# -2: critical+errors+warnings (default)
161 +debuglevel = -{ $yum{Debug} || '2' }
162 +
163 +# skip_broken = True
164 +
165 +# use this to change metadata download
166 +# `instant' - Just download the new metadata index, this is roughly what yum always did, however it now does some checking on the index and reverts if it classifies it as bad.
167 +# `group:primary' - Download the primary metadata with the index. This contains most of the package information and so is almost always required anyway.
168 +# `group:small' - With the primary also download the updateinfo metadata, groups, and pkgtags. This is required for yum-security operations and it also used in the graphical clients. This file also tends to be signifi‐
169 +# cantly smaller than most others. This is the default.
170 +# `group:main' - With the primary and updateinfo download the filelists metadata and the group metadata. The filelists data is required for operations like "yum install /bin/bash", and also some dependency resolutions
171 +# require it. The group data is used in some graphical clients and for group operations like "yum grouplist Base".
172 +# `group:all' - Download all metadata listed in the index, currently the only one not listed above is the other metadata, which contains the changelog information which is used by yum-changelog. This is what "yum make‐
173 +# cache" uses.
174 +mdpolicy = group:main
175 +
176 +# Uncomment to auto-import new gpg keys (dangerous)
177 +# assumeyes = True
178 +
179 diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/web/functions/yum smeserver-yum-2.6.0/root/etc/e-smith/web/functions/yum
180 --- smeserver-yum-2.6.0.old/root/etc/e-smith/web/functions/yum 2019-12-06 17:36:57.162000000 -0500
181 +++ smeserver-yum-2.6.0/root/etc/e-smith/web/functions/yum 2019-12-08 15:30:35.592916524 -0500
182 @@ -137,6 +137,12 @@
183 value="get_status('DownloadOnly', 'localise')">
184 <label>LABEL_YUM_DOWNLOADONLY</label>
185 </field>
186 + <field
187 + type="literal"
188 + id="state_AutoInstallUpdates"
189 + value="get_status('AutoInstallUpdates', 'localise')">
190 + <label>LABEL_YUM_AUTOINSTALLUPDATES</label>
191 + </field>
192
193 <field
194 type="literal"
195 @@ -277,6 +283,15 @@
196 <description>LABEL_YUM_DOWNLOADONLY_DESCRIPTION</description>
197 </field>
198
199 + <field
200 + type="select"
201 + id="yum_AutoInstallUpdates"
202 + options="'disabled' => 'DISABLED','enabled'=>'ENABLED'"
203 + value="get_status('AutoInstallUpdates')">
204 + <label>LABEL_YUM_AUTOINSTALLUPDATES</label>
205 + <description>LABEL_YUM_AUTOINSTALLUPDATES_DESCRIPTION</description>
206 + </field>
207 +
208 <subroutine src="print_button('SAVE')" />
209 </page>
210
211 diff -Nur smeserver-yum-2.6.0.old/root/sbin/e-smith/check4updates smeserver-yum-2.6.0/root/sbin/e-smith/check4updates
212 --- smeserver-yum-2.6.0.old/root/sbin/e-smith/check4updates 2019-12-06 17:36:57.303000000 -0500
213 +++ smeserver-yum-2.6.0/root/sbin/e-smith/check4updates 2019-12-08 15:44:26.775293620 -0500
214 @@ -20,7 +20,8 @@
215 yum -e 0 -d 0 check-update > $TMP1
216 if [ $? = 100 ]; then
217 echo -e "===\n=== yum reports available updates:\n===" >> $TMPFILE
218 - cat $TMP1 >> $TMPFILE
219 + /usr/sbin/yum-cron /etc/yum/yum-cron.conf >> $TMPFILE
220 + #cat $TMP1 >> $TMPFILE
221 # we have updates, let's inform the server-manager
222 /usr/bin/sv o yum
223
224 diff -Nur smeserver-yum-2.6.0.old/root/sbin/e-smith/yumdownloadonly smeserver-yum-2.6.0/root/sbin/e-smith/yumdownloadonly
225 --- smeserver-yum-2.6.0.old/root/sbin/e-smith/yumdownloadonly 2019-12-06 17:36:57.162000000 -0500
226 +++ smeserver-yum-2.6.0/root/sbin/e-smith/yumdownloadonly 1969-12-31 19:00:00.000000000 -0500
227 @@ -1,26 +0,0 @@
228 -#! /bin/bash
229 -
230 -mkdir -p /tmp/downloadonly.$$
231 -TMPFILE=`mktemp /tmp/downloadonly.$$/XXXXXXXXXX` || exit 1
232 -TMP1=`mktemp /tmp/downloadonly.$$/XXXXXXXXXX` || exit 1
233 -
234 -MAILADDR=admin-yum
235 -
236 -yum -e 0 -d 0 check-update >/dev/null
237 -if [ $? = 100 ]; then
238 - yum update -e 0 -d 1 --downloadonly -y > $TMP1
239 - echo -e "===\n=== yum reports downloaded files:\n===" >> $TMPFILE
240 - cat $TMP1 >> $TMPFILE
241 -fi
242 -
243 -if [ -s $TMPFILE ]; then
244 - if [ "$1" = "-m" ]; then
245 - mail -s "Downloaded updates for `hostname`" $MAILADDR < $TMPFILE
246 - else
247 - echo "Downloaded updates for `hostname`"
248 - cat $TMPFILE
249 - fi
250 -fi
251 -
252 -rm -f $TMPFILE $TMP1
253 -rm -fr /tmp/downloadonly.*
254 diff -Nur smeserver-yum-2.6.0.old/root/sbin/e-smith/yum_update_dbs smeserver-yum-2.6.0/root/sbin/e-smith/yum_update_dbs
255 --- smeserver-yum-2.6.0.old/root/sbin/e-smith/yum_update_dbs 2019-12-06 17:36:57.307000000 -0500
256 +++ smeserver-yum-2.6.0/root/sbin/e-smith/yum_update_dbs 2019-12-07 00:18:52.879002719 -0500
257 @@ -23,17 +23,20 @@
258
259 my $db = esmith::ConfigDB->open_ro or die "Couldn't open ConfigDB\n";
260
261 -use constant YUM_CRON_FLAG => '/var/lock/subsys/yum';
262 -
263 -if ($db->get_prop('yum', 'AutoInstallUpdates') eq 'enabled')
264 -{
265 - (system('/bin/touch', YUM_CRON_FLAG) == 0) or
266 - warn "Couldn't touch " . YUM_CRON_FLAG . "\n";
267 -}
268 -else
269 -{
270 +use constant YUM_CRON_FLAG => '/var/lock/subsys/yum-cron';
271 +# we do not use yum-cron /etc/cron.daily file
272 +# so we keep away the subsys file
273 +#if ($db->get_prop('yum', 'AutoInstallUpdates') eq 'enabled')
274 +#{
275 +# (system('/bin/touch', YUM_CRON_FLAG) == 0) or
276 +# warn "Couldn't touch " . YUM_CRON_FLAG . "\n";
277 +#}
278 +#else
279 +#{
280 + system("/usr/bin/systemctl -q stop yum-cron");
281 + system("/usr/bin/systemctl -q mask yum-cron");
282 unlink YUM_CRON_FLAG;
283 -}
284 +#}
285
286 # XXX - WARNING - XXX
287 #
288 diff -Nur smeserver-yum-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm smeserver-yum-2.6.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm
289 --- smeserver-yum-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm 2019-12-06 17:36:57.162000000 -0500
290 +++ smeserver-yum-2.6.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm 2019-12-08 15:41:55.239398968 -0500
291 @@ -205,14 +205,21 @@
292 if ($check4updates ne 'disabled') { $status = 'enabled'; }
293
294 $db->set_prop('yum', 'check4updates', $check4updates);
295 - $db->set_prop('yum', 'status', $status);
296
297 my $deltarpm = $q->param("yum_DeltaRpmProcess");
298 $db->set_prop('yum', 'DeltaRpmProcess', $deltarpm);
299
300 my $downloadonly = $q->param("yum_DownloadOnly");
301 + if ($downloadonly ne 'disabled') { $status = 'enabled'; }
302 +
303 $db->set_prop('yum', 'DownloadOnly', $downloadonly);
304
305 + my $AutoInstallUpdates = $q->param("yum_AutoInstallUpdates");
306 + if ($AutoInstallUpdates ne 'disabled') { $status = 'enabled'; }
307 +
308 + $db->set_prop('yum', 'AutoInstallUpdates', $AutoInstallUpdates);
309 + $db->set_prop('yum', 'status', $status);
310 +
311 my %selected = map {$_ => 1} $q->param('SelectedRepositories');
312
313 foreach my $repos (

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