initial commit of file from CVS for smeserver-yum on Thu 26 Oct 11:26:23 BST 2023
This commit is contained in:
30
root/etc/e-smith/templates/etc/crontab/check4contribsupdates
Normal file
30
root/etc/e-smith/templates/etc/crontab/check4contribsupdates
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
use esmith::ConfigDB;
|
||||
my $ydb = esmith::ConfigDB->open_ro('yum_repositories')
|
||||
or die "Couldn't open yum_repositories";
|
||||
my $smecontribs=$ydb->get_prop('smecontribs','status') || 'disabled';
|
||||
|
||||
return "\n# yum check for smecontribs updates is disabled\n" unless ( ($yum{status} eq 'enabled') && ($yum{CheckContribs} eq 'enabled') && ($smecontribs eq 'disabled') );
|
||||
|
||||
my $freq = $yum{check4updates} || 'daily';
|
||||
|
||||
my $min;
|
||||
my $dom;
|
||||
my $dow;
|
||||
|
||||
if ($freq eq 'weekly') {
|
||||
$min = 22;
|
||||
$dom = '*';
|
||||
$dow = 0;
|
||||
} elsif ($freq eq 'monthly') {
|
||||
$min = 42;
|
||||
$dom = 1;
|
||||
$dow = '*';
|
||||
} else {
|
||||
$min = 2;
|
||||
$dom = '*';
|
||||
$dow = '*';
|
||||
}
|
||||
return "$min 4 $dom * $dow root "
|
||||
. q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4contribsupdates -m };
|
||||
}
|
25
root/etc/e-smith/templates/etc/crontab/check4updates
Normal file
25
root/etc/e-smith/templates/etc/crontab/check4updates
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
return "\n# yum check for updates is disabled\n" unless $yum{status} eq 'enabled';
|
||||
|
||||
my $freq = $yum{check4updates} || 'daily';
|
||||
|
||||
my $min;
|
||||
my $dom;
|
||||
my $dow;
|
||||
|
||||
if ($freq eq 'weekly') {
|
||||
$min = 22;
|
||||
$dom = '*';
|
||||
$dow = 0;
|
||||
} elsif ($freq eq 'monthly') {
|
||||
$min = 42;
|
||||
$dom = 1;
|
||||
$dow = '*';
|
||||
} else {
|
||||
$min = 2;
|
||||
$dom = '*';
|
||||
$dow = '*';
|
||||
}
|
||||
return "$min 4 $dom * $dow root "
|
||||
. q{sleep $[ $RANDOM \\% 3600 ]; /sbin/e-smith/check4updates -m };
|
||||
}
|
4
root/etc/e-smith/templates/etc/rsyslog.conf/32yum
Normal file
4
root/etc/e-smith/templates/etc/rsyslog.conf/32yum
Normal file
@@ -0,0 +1,4 @@
|
||||
#yum
|
||||
if $programname startswith "yum_update_dbs" then /var/log/yum/yum-update.log
|
||||
& stop
|
||||
|
1
root/etc/e-smith/templates/etc/yum.conf/10main
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main
Normal file
@@ -0,0 +1 @@
|
||||
[main]
|
2
root/etc/e-smith/templates/etc/yum.conf/10main_cachedir
Normal file
2
root/etc/e-smith/templates/etc/yum.conf/10main_cachedir
Normal file
@@ -0,0 +1,2 @@
|
||||
cachedir=/var/cache/yum/$basearch/$releasever
|
||||
keepcache=0
|
@@ -0,0 +1 @@
|
||||
debuglevel={ $yum{Debug} || '2' }
|
6
root/etc/e-smith/templates/etc/yum.conf/10main_deltarpm
Normal file
6
root/etc/e-smith/templates/etc/yum.conf/10main_deltarpm
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
my $deltaRpm = $yum{DeltaRpmProcess} || 'disabled';
|
||||
$deltaRpm = '0' if ($deltaRpm eq 'disabled');
|
||||
$deltaRpm = '2' if ($deltaRpm eq 'enabled');
|
||||
$OUT .= "deltarpm=$deltaRpm";
|
||||
}
|
@@ -0,0 +1 @@
|
||||
distroverpkg=centos-release
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_exactarch
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_exactarch
Normal file
@@ -0,0 +1 @@
|
||||
exactarch=1
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_httpcache
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_httpcache
Normal file
@@ -0,0 +1 @@
|
||||
http_caching=packages
|
@@ -0,0 +1 @@
|
||||
installonly_limit=3
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_logfile
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_logfile
Normal file
@@ -0,0 +1 @@
|
||||
logfile=/var/log/yum/yum.log
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_obsoletes
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_obsoletes
Normal file
@@ -0,0 +1 @@
|
||||
obsoletes=1
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_plugins
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_plugins
Normal file
@@ -0,0 +1 @@
|
||||
plugins=1
|
1
root/etc/e-smith/templates/etc/yum.conf/10main_tolerant
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/10main_tolerant
Normal file
@@ -0,0 +1 @@
|
||||
tolerant=1
|
1
root/etc/e-smith/templates/etc/yum.conf/20main_reposdir
Normal file
1
root/etc/e-smith/templates/etc/yum.conf/20main_reposdir
Normal file
@@ -0,0 +1 @@
|
||||
reposdir=/etc/yum.smerepos.d
|
@@ -0,0 +1,74 @@
|
||||
{
|
||||
my $ydb = esmith::ConfigDB->open_ro('yum_repositories')
|
||||
or die "Couldn't open yum_repositories";
|
||||
|
||||
my $priority = $yum{priority} || 'enabled';
|
||||
|
||||
$OUT = "\n";
|
||||
|
||||
for my $repos ( $ydb->get_all_by_prop('type' => 'repository') )
|
||||
{
|
||||
my %props = ($DB->get('yum')->props(), $repos->props());
|
||||
|
||||
$OUT .= "[" . $repos->key . "]\n";
|
||||
|
||||
$OUT .= "enabled=" . (($repos->prop('status') eq 'enabled') ? 1 : 0)
|
||||
. "\n";
|
||||
|
||||
if ( ! exists $props{MirrorList} or $props{MirrorList} eq "disabled" )
|
||||
{
|
||||
$OUT .= 'baseurl=' . $props{BaseURL} . "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUT .= 'mirrorlist=' . $props{MirrorList} . "\n";
|
||||
}
|
||||
|
||||
for my $prop (qw(Name))
|
||||
{
|
||||
$OUT .= lc($prop) . '=' . $props{$prop} . "\n";
|
||||
}
|
||||
|
||||
for my $prop (qw(GPGCheck EnableGroups))
|
||||
{
|
||||
$OUT .= lc($prop) . '=' . ($props{$prop} eq "yes" ? 1 : 0) . "\n";
|
||||
}
|
||||
|
||||
if (exists $props{Exclude})
|
||||
{
|
||||
$OUT .= "exclude=" . join(' ', split(/,/, $props{Exclude})) . "\n";
|
||||
}
|
||||
|
||||
if (exists $props{IncludePkgs})
|
||||
{
|
||||
$OUT .= "includepkgs=" . join(' ', split(/,/, $props{IncludePkgs})) . "\n";
|
||||
}
|
||||
|
||||
if ( exists $props{GPGKey})
|
||||
{
|
||||
$OUT .= "gpgkey" . '=' . $props{GPGKey} . "\n";
|
||||
}
|
||||
|
||||
if ($priority eq 'enabled' && exists $props{Priority})
|
||||
{
|
||||
$OUT .= "priority" . '=' . $props{Priority} . "\n";
|
||||
}
|
||||
elsif ($priority eq 'enabled' && $repos->key =~ /^sme.*/)
|
||||
{
|
||||
$OUT .= "priority=10\n";
|
||||
}
|
||||
elsif ($priority eq 'enabled' && ( $repos->key eq 'base' || $repos->key eq 'updates' || $repos->key eq 'remi-safe' ))
|
||||
{
|
||||
$OUT .= "priority=10\n";
|
||||
}
|
||||
|
||||
if (exists $props{DeltaRpmPercentage})
|
||||
{
|
||||
my $deltarpmpercentage = $props{DeltaRpmPercentage};
|
||||
$deltarpmpercentage = '0' if ($deltarpmpercentage eq 'disabled');
|
||||
$OUT .= "deltarpm_percentage" . '=' . $deltarpmpercentage . "\n";
|
||||
}
|
||||
|
||||
$OUT .= "\n";
|
||||
}
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
$pkgs = $yum{Protected} || 'e-smith-base,smeserver-support';
|
||||
$OUT = join "\n", split /[,;]/, $pkgs;
|
||||
}
|
42
root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands
Normal file
42
root/etc/e-smith/templates/etc/yum/yum-cron.conf/10commands
Normal file
@@ -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' }
|
||||
|
||||
|
18
root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters
Normal file
18
root/etc/e-smith/templates/etc/yum/yum-cron.conf/20emiters
Normal file
@@ -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' }
|
||||
|
||||
|
||||
|
12
root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email
Normal file
12
root/etc/e-smith/templates/etc/yum/yum-cron.conf/30email
Normal file
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
25
root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base
Normal file
25
root/etc/e-smith/templates/etc/yum/yum-cron.conf/50base
Normal file
@@ -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
|
||||
|
Reference in New Issue
Block a user