diff -Nur smeserver-yum-2.6.0.old/createlinks smeserver-yum-2.6.0/createlinks
--- smeserver-yum-2.6.0.old/createlinks 2016-02-05 18:19:56.000000000 -0500
+++ smeserver-yum-2.6.0/createlinks 2019-12-08 16:32:13.671000000 -0500
@@ -5,7 +5,7 @@
use File::Path;
foreach my $file (qw(/etc/yum.conf /etc/yum/protected.d/smeserver.conf
- /etc/yum.smerepos.d/sme-base.repo))
+ /etc/yum.smerepos.d/sme-base.repo /etc/yum/yum-cron.conf))
{
templates2events($file, qw(yum-modify bootstrap-console-save));
}
@@ -19,7 +19,9 @@
event_link("navigation-conf", "yum-$_", "80");
}
-for ( qw(install remove update modify) )
+# yum-update-dbs is launched by smeserver yum plugin,
+# it isnot needed anymore in install remove and update events
+for ( qw(modify) )
{
event_link("yum-update-dbs", "yum-$_", "90");
}
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
--- 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
+++ 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
@@ -20,6 +20,10 @@
LABEL_YUM_AUTOINSTALLUPDATES
Automatically install updates
+
+ LABEL_YUM_AUTOINSTALLUPDATES_DESCRIPTION
+ 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.
+ LABEL_YUM_PACKAGEFUNCTIONS
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
--- smeserver-yum-2.6.0.old/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly 2019-12-06 17:36:57.161000000 -0500
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/crontab/YumDownloadOnly 1969-12-31 19:00:00.000000000 -0500
@@ -1,11 +0,0 @@
-{
- return "\n# yum status is disabled\n" unless $yum{status} eq 'enabled';
-
- my $downloadonly = $yum{DownloadOnly} || 'disabled';
-
- return "\n# Yum download only is disabled" if ($downloadonly eq 'disabled');
- my $hour = $yum{DownloadOnlyHour} || '4';
- return "2 $hour * * * root "
- . q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/yumdownloadonly -m };
-
-}
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
--- 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
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands 2019-12-08 16:26:45.745528729 -0500
@@ -0,0 +1,42 @@
+{
+ our $AutoInstallUpdates = $yum{AutoInstallUpdates} || 'disabled';
+ $AutoInstallUpdates = ( $AutoInstallUpdates eq "disabled") ? "no" : "yes";
+ our $downloadonly = $yum{DownloadOnly} || 'disabled';
+ $downloadonly = ($downloadonly eq "disabled") ? "no" : "yes";
+ our $check = $yum{check4updates} || 'daily';
+ $check = ($check eq "disabled") ? "no" : "yes";
+ $check = ($downloadonly eq "yes" || $AutoInstallUpdates eq "yes" ) ? "yes" : $check;
+ $OUT = "";
+}
+[commands]
+# What kind of update to use:
+# default = yum upgrade
+# security = yum --security upgrade
+# security-severity:Critical = yum --sec-severity=Critical upgrade
+# minimal = yum --bugfix update-minimal
+# minimal-security = yum --security update-minimal
+# minimal-security-severity:Critical = --sec-severity=Critical update-minimal
+# Note: CentOS and Koozali SME Server do not provide the necessary information
+# in order to have security and minimal upgrade functionality.
+update_cmd = default
+
+# Whether a message should be emitted when updates are available,
+# were downloaded, or applied.
+update_messages = { $check || "yes" }
+
+# Whether updates should be downloaded when they are available.
+download_updates = { $downloadonly || "no" }
+
+# Whether updates should be applied when they are available. Note
+# that download_updates must also be yes for the update to be applied.
+apply_updates = { $AutoInstallUpdates }
+
+# Maximum amout of time to randomly sleep, in minutes. The program
+# will sleep for a random amount of time between 0 and random_sleep
+# minutes before running. This is useful for e.g. staggering the
+# times that multiple systems will access update servers. If
+# random_sleep is 0 or negative, the program will run immediately.
+# 6*60 = 360
+random_sleep = { $yum{sleep} || '0' }
+
+
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
--- 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
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters 2019-12-08 16:17:02.599046123 -0500
@@ -0,0 +1,18 @@
+[emitters]
+# Name to use for this system in messages that are emitted. If
+# system_name is None, the hostname will be used.
+system_name = { $SystemName . "." . $DomainName || 'None' }
+
+# How to send messages. Valid options are stdio and email. If
+# emit_via includes stdio, messages will be sent to stdout; this is useful
+# to have cron send the messages. If emit_via includes email, this
+# program will send email itself according to the configured options.
+# If emit_via is None or left blank, no messages will be sent.
+emit_via = stdio
+
+# The width, in characters, that messages that are emitted should be
+# formatted to.
+output_width = { $yum{output_width} || '100' }
+
+
+
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
--- 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
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email 2019-12-08 16:17:28.659737216 -0500
@@ -0,0 +1,12 @@
+[email]
+# The address to send email messages from.
+# NOTE: 'localhost' will be replaced with the value of system_name.
+email_from = { 'root@' . $DomainName }
+
+# List of addresses to send messages to.
+email_to = { $yum{ReportEmail} || 'admin@' . $DomainName }
+
+# Name of the host to connect to to send email messages.
+email_host = localhost
+
+
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
--- 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
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/40groups 2019-12-08 16:13:59.923198616 -0500
@@ -0,0 +1,9 @@
+[groups]
+# NOTE: This only works when group_command != objects, which is now the default
+# List of groups to update
+group_list = None
+
+# The types of group packages to install
+group_package_types = mandatory, core, default
+
+
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
--- 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
+++ smeserver-yum-2.6.0/root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base 2019-12-08 16:15:32.440654375 -0500
@@ -0,0 +1,25 @@
+[base]
+# This section overrides yum.conf
+
+# Use this to filter Yum core messages
+# -4: critical
+# -3: critical+errors
+# -2: critical+errors+warnings (default)
+debuglevel = -{ $yum{Debug} || '2' }
+
+# skip_broken = True
+
+# use this to change metadata download
+# `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.
+# `group:primary' - Download the primary metadata with the index. This contains most of the package information and so is almost always required anyway.
+# `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‐
+# cantly smaller than most others. This is the default.
+# `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
+# require it. The group data is used in some graphical clients and for group operations like "yum grouplist Base".
+# `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‐
+# cache" uses.
+mdpolicy = group:main
+
+# Uncomment to auto-import new gpg keys (dangerous)
+# assumeyes = True
+
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
--- smeserver-yum-2.6.0.old/root/etc/e-smith/web/functions/yum 2019-12-06 17:36:57.162000000 -0500
+++ smeserver-yum-2.6.0/root/etc/e-smith/web/functions/yum 2019-12-08 15:30:35.592916524 -0500
@@ -137,6 +137,12 @@
value="get_status('DownloadOnly', 'localise')">
+
+
+ LABEL_YUM_DOWNLOADONLY_DESCRIPTION
+
+
+ LABEL_YUM_AUTOINSTALLUPDATES_DESCRIPTION
+
+
diff -Nur smeserver-yum-2.6.0.old/root/sbin/e-smith/check4updates smeserver-yum-2.6.0/root/sbin/e-smith/check4updates
--- smeserver-yum-2.6.0.old/root/sbin/e-smith/check4updates 2019-12-06 17:36:57.303000000 -0500
+++ smeserver-yum-2.6.0/root/sbin/e-smith/check4updates 2019-12-08 15:44:26.775293620 -0500
@@ -20,7 +20,8 @@
yum -e 0 -d 0 check-update > $TMP1
if [ $? = 100 ]; then
echo -e "===\n=== yum reports available updates:\n===" >> $TMPFILE
- cat $TMP1 >> $TMPFILE
+ /usr/sbin/yum-cron /etc/yum/yum-cron.conf >> $TMPFILE
+ #cat $TMP1 >> $TMPFILE
# we have updates, let's inform the server-manager
/usr/bin/sv o yum
diff -Nur smeserver-yum-2.6.0.old/root/sbin/e-smith/yumdownloadonly smeserver-yum-2.6.0/root/sbin/e-smith/yumdownloadonly
--- smeserver-yum-2.6.0.old/root/sbin/e-smith/yumdownloadonly 2019-12-06 17:36:57.162000000 -0500
+++ smeserver-yum-2.6.0/root/sbin/e-smith/yumdownloadonly 1969-12-31 19:00:00.000000000 -0500
@@ -1,26 +0,0 @@
-#! /bin/bash
-
-mkdir -p /tmp/downloadonly.$$
-TMPFILE=`mktemp /tmp/downloadonly.$$/XXXXXXXXXX` || exit 1
-TMP1=`mktemp /tmp/downloadonly.$$/XXXXXXXXXX` || exit 1
-
-MAILADDR=admin-yum
-
-yum -e 0 -d 0 check-update >/dev/null
-if [ $? = 100 ]; then
- yum update -e 0 -d 1 --downloadonly -y > $TMP1
- echo -e "===\n=== yum reports downloaded files:\n===" >> $TMPFILE
- cat $TMP1 >> $TMPFILE
-fi
-
-if [ -s $TMPFILE ]; then
- if [ "$1" = "-m" ]; then
- mail -s "Downloaded updates for `hostname`" $MAILADDR < $TMPFILE
- else
- echo "Downloaded updates for `hostname`"
- cat $TMPFILE
- fi
-fi
-
-rm -f $TMPFILE $TMP1
-rm -fr /tmp/downloadonly.*
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
--- smeserver-yum-2.6.0.old/root/sbin/e-smith/yum_update_dbs 2019-12-06 17:36:57.307000000 -0500
+++ smeserver-yum-2.6.0/root/sbin/e-smith/yum_update_dbs 2019-12-07 00:18:52.879002719 -0500
@@ -23,17 +23,20 @@
my $db = esmith::ConfigDB->open_ro or die "Couldn't open ConfigDB\n";
-use constant YUM_CRON_FLAG => '/var/lock/subsys/yum';
-
-if ($db->get_prop('yum', 'AutoInstallUpdates') eq 'enabled')
-{
- (system('/bin/touch', YUM_CRON_FLAG) == 0) or
- warn "Couldn't touch " . YUM_CRON_FLAG . "\n";
-}
-else
-{
+use constant YUM_CRON_FLAG => '/var/lock/subsys/yum-cron';
+# we do not use yum-cron /etc/cron.daily file
+# so we keep away the subsys file
+#if ($db->get_prop('yum', 'AutoInstallUpdates') eq 'enabled')
+#{
+# (system('/bin/touch', YUM_CRON_FLAG) == 0) or
+# warn "Couldn't touch " . YUM_CRON_FLAG . "\n";
+#}
+#else
+#{
+ system("/usr/bin/systemctl -q stop yum-cron");
+ system("/usr/bin/systemctl -q mask yum-cron");
unlink YUM_CRON_FLAG;
-}
+#}
# XXX - WARNING - XXX
#
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
--- 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
+++ smeserver-yum-2.6.0/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm 2019-12-08 15:41:55.239398968 -0500
@@ -205,14 +205,21 @@
if ($check4updates ne 'disabled') { $status = 'enabled'; }
$db->set_prop('yum', 'check4updates', $check4updates);
- $db->set_prop('yum', 'status', $status);
my $deltarpm = $q->param("yum_DeltaRpmProcess");
$db->set_prop('yum', 'DeltaRpmProcess', $deltarpm);
my $downloadonly = $q->param("yum_DownloadOnly");
+ if ($downloadonly ne 'disabled') { $status = 'enabled'; }
+
$db->set_prop('yum', 'DownloadOnly', $downloadonly);
+ my $AutoInstallUpdates = $q->param("yum_AutoInstallUpdates");
+ if ($AutoInstallUpdates ne 'disabled') { $status = 'enabled'; }
+
+ $db->set_prop('yum', 'AutoInstallUpdates', $AutoInstallUpdates);
+ $db->set_prop('yum', 'status', $status);
+
my %selected = map {$_ => 1} $q->param('SelectedRepositories');
foreach my $repos (