generated from smedev/Template-for-SMEServer-Core-Package
initial
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# dnf check for smecontribs updates is disabled\n" unless ( ($dnf{status} eq 'enabled') && ($dnf{CheckContribs} eq 'enabled') && ($smecontribs eq 'disabled') );
|
||||
|
||||
my $freq = $dnf{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# dnf check for updates is disabled\n" unless $dnf{status} eq 'enabled';
|
||||
|
||||
my $freq = $dnf{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 };
|
||||
}
|
39
root/etc/e-smith/templates/etc/dnf/automatic.conf/10commands
Normal file
39
root/etc/e-smith/templates/etc/dnf/automatic.conf/10commands
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
our $AutoInstallUpdates = $dnf{AutoInstallUpdates} || 'disabled';
|
||||
$AutoInstallUpdates = ( $AutoInstallUpdates eq "disabled") ? "no" : "yes";
|
||||
our $downloadonly = $dnf{DownloadOnly} || 'disabled';
|
||||
$downloadonly = ($downloadonly eq "disabled") ? "no" : "yes";
|
||||
our $check = $dnf{check4updates} || 'daily';
|
||||
$check = ($check eq "disabled") ? "no" : "yes";
|
||||
$check = ($downloadonly eq "yes" || $AutoInstallUpdates eq "yes" ) ? "yes" : $check;
|
||||
$OUT = "";
|
||||
}
|
||||
[commands]
|
||||
# What kind of upgrade to perform:
|
||||
# default = all available upgrades
|
||||
# security = only the security upgrades
|
||||
upgrade_type = default
|
||||
|
||||
# Maximum time in seconds to wait until the system is on-line and able to
|
||||
# connect to remote repositories.
|
||||
network_online_timeout = 60
|
||||
|
||||
# Whether updates should be downloaded when they are available, by
|
||||
# dnf-automatic.timer. notifyonly.timer, download.timer and
|
||||
# install.timer override this setting.
|
||||
download_updates = { $downloadonly }
|
||||
|
||||
# Whether updates should be applied when they are available, by
|
||||
# dnf-automatic.timer. notifyonly.timer, download.timer and
|
||||
# install.timer override this setting.
|
||||
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 = { $dnf{sleep} || '0' }
|
||||
|
||||
|
13
root/etc/e-smith/templates/etc/dnf/automatic.conf/20emiters
Normal file
13
root/etc/e-smith/templates/etc/dnf/automatic.conf/20emiters
Normal file
@@ -0,0 +1,13 @@
|
||||
[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
|
||||
|
||||
|
12
root/etc/e-smith/templates/etc/dnf/automatic.conf/30email
Normal file
12
root/etc/e-smith/templates/etc/dnf/automatic.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 = { $dnf{ReportEmail} || 'admin@' . $DomainName }
|
||||
|
||||
# Name of the host to connect to to send email messages.
|
||||
email_host = localhost
|
||||
|
||||
|
12
root/etc/e-smith/templates/etc/dnf/automatic.conf/50base
Normal file
12
root/etc/e-smith/templates/etc/dnf/automatic.conf/50base
Normal file
@@ -0,0 +1,12 @@
|
||||
[base]
|
||||
# This section overrides dnf.conf
|
||||
|
||||
# Use this to filter dnf core messages
|
||||
# -4: critical
|
||||
# -3: critical+errors
|
||||
# -2: critical+errors+warnings (default)
|
||||
debuglevel = -{ $dnf{Debug} || '2' }
|
||||
|
||||
# Uncomment to auto-import new gpg keys (dangerous)
|
||||
# assumeyes = True
|
||||
|
1
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main
Normal file
1
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main
Normal file
@@ -0,0 +1 @@
|
||||
[main]
|
1
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_best
Normal file
1
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_best
Normal file
@@ -0,0 +1 @@
|
||||
best=0
|
@@ -0,0 +1,2 @@
|
||||
cachedir=/var/cache/dnf/$basearch/$releasever
|
||||
keepcache=0
|
@@ -0,0 +1 @@
|
||||
debuglevel={ $yum{Debug} || '2' }
|
@@ -0,0 +1,6 @@
|
||||
{
|
||||
my $deltaRpm = $dnf{DeltaRpmProcess} || 'disabled';
|
||||
$deltaRpm = '0' if ($deltaRpm eq 'disabled');
|
||||
$deltaRpm = '2' if ($deltaRpm eq 'enabled');
|
||||
$OUT .= "deltarpm=$deltaRpm";
|
||||
}
|
@@ -0,0 +1 @@
|
||||
installonly_limit=3
|
@@ -0,0 +1 @@
|
||||
logdir=/var/log/dnf
|
@@ -0,0 +1 @@
|
||||
obsoletes=1
|
@@ -0,0 +1 @@
|
||||
plugins=1
|
2
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_skip
Normal file
2
root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_skip
Normal file
@@ -0,0 +1,2 @@
|
||||
skip_if_unavailable=0
|
||||
|
@@ -0,0 +1 @@
|
||||
reposdir=/etc/yum.smerepos.d
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
$pkgs = $dnf{Protected} || 'smeserver-base,smeserver-support';
|
||||
$OUT = join "\n", split /[,;]/, $pkgs;
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
#dnf Koozali SME Server updater
|
||||
if $programname startswith "dnf_update_dbs" then /var/log/dnf/dnf-update.log
|
||||
& stop
|
||||
|
@@ -0,0 +1,78 @@
|
||||
{
|
||||
my $ydb = esmith::ConfigDB->open_ro('yum_repositories')
|
||||
or die "Couldn't open yum_repositories";
|
||||
|
||||
my $priority = $dnf{priority} || 'enabled';
|
||||
|
||||
$OUT = "\n";
|
||||
|
||||
for my $repos ( $ydb->get_all_by_prop('type' => 'repository') )
|
||||
{
|
||||
my %props = ($DB->get('dnf')->props(), $repos->props());
|
||||
|
||||
$OUT .= "[" . $repos->key . "]\n";
|
||||
|
||||
$OUT .= "enabled=" . (($repos->prop('status') eq 'enabled') ? 1 : 0)
|
||||
. "\n";
|
||||
|
||||
if ( exists $props{MetaLink} )
|
||||
{
|
||||
$OUT .= 'metalink=' . $props{MetaLink} . "\n";
|
||||
}
|
||||
elsif ( ! 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 'appstream' || $repos->key eq 'baseos' || $repos->key eq 'remi-safe' || $repos->key eq 'remi-modular' ))
|
||||
{
|
||||
$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";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user