Commit Graph

243 Commits

Author SHA1 Message Date
Petr Písař c2bc7041c4 doc: Example send_error_messages in /etc/dnf/automatic.conf
The option was documented in a manual page, but it wasn't mentioned in
the default configuration file.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2318136
2024-10-16 11:04:48 +02:00
Jaroslav Mracek 78e2838c62 Drop collect file for ABRT
It looks like that it is not required anymore

Resolve: https://issues.redhat.com/browse/RHEL-40382
2024-06-12 10:38:10 +02:00
Jan Kolarik 4334ea254a bash-completion: Prepare ownerships for dnf5 switch
Use `dnf-3` and `dnf4` files for bash completion and link the `dnf` only when `dnf5` is not used yet.
2024-03-28 14:04:31 +01:00
Jan Kolarik 75803f54d1 bash-completion: Complete dnf command only if we own it 2024-03-28 14:04:31 +01:00
Evan Goode df137e7c7f [spec] Remove /etc/dnf/protected.d/dnf.conf
Instead, hardcode the protection of dnf in libdnf. This way, DNF 5 will
be able to uninstall DNF 4.

= changelog =
msg: Allow dnf to be removed by DNF 5
type: enhancement
2023-09-25 10:39:09 +02:00
Dominik 'Rathann' Mierzejewski a0acc88efc add a default option for email_tls in automatic.conf 2023-08-31 14:58:29 +02:00
Nicola Sella 0f15b2d04e Revert "Unprotect dnf and yum, protect python3-dnf"
This reverts commit 352b174a0b.
adding the condition %{witout dnf5_obsoletes_dnf} to keep the
unprotected directive for chroots that build dnf with rpm
option with=dnf5_obsoletes_dnf
2023-08-30 16:58:25 +00:00
Dominik 'Rathann' Mierzejewski 6642e3daf2 add a default option for email_port in automatic.conf 2023-08-29 12:41:56 +02:00
grumpey 33fde245b0 Fix bash completion due to sqlite changes
= changelog =
msg:  Fix bash completion due to sqlite changes          
type:  bugfix
resolves:  https://bugzilla.redhat.com/show_bug.cgi?id=2232052   
related:  https://sqlite.org/src/info/c995932c3ffe7f27
2023-08-21 08:52:25 -04:00
Jaroslav Mracek 4548e6a443 DNF5 should not deprecate DNF on Fedora38
Move command provides to python3-dnf

In fedora distribution there are two packages that depends on those
provides therefor the movement of those provide to real provider should
help with transition to dnf5 or at least it allows to use the old dnf4
after obsolete of dnf package.
2023-05-26 16:31:59 +02:00
Evan Goode 6d978062a1 Remove ownership of dnf.conf, protected.d, vars 2023-05-25 15:50:25 +02:00
Evan Goode 352b174a0b Unprotect dnf and yum, protect python3-dnf 2023-05-18 10:14:39 +02:00
Evan Goode 7a623b9d42 DNF Automatic reboot: 5-minute delay and wall by default 2023-01-26 15:33:20 +01:00
Evan Goode 908991f2bf Add reboot option to DNF Automatic (RhBug:2124793)
Add ability in DNF Automatic to automatically trigger a reboot after an
upgrade. The `reboot` option supports three settings: ``never`` does not
reboot the system (current behavior). ``when-changed`` triggers a reboot
after any upgrade. ``when-needed`` triggers a reboot only when rebooting
is necessary to apply changes, such as when systemd or the kernel is
upgraded. The `reboot_command` option allows customizing the command
used to reboot (default is `shutdown -r`).

= changelog =
msg: Add `reboot` option to DNF Automatic
type: enhancement
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2124793
2023-01-26 15:33:20 +01:00
plenusredemptio 0332e30c77 Small change to better present the option
To show unequivocally that it is a boolean option.
2022-05-23 15:26:47 +02:00
Robin Jarry c1a407eba3 bash-completion: use sqlite cache when available
Use /var/cache/dnf/packages.db to make SQL requests instead of parsing
the repodata files at each tab completion. This makes completing package
names much snappier.

This is an inspiration from zsh dnf completion:
https://github.com/zsh-users/zsh/blob/zsh-5.8.1/Completion/Redhat/Command/_dnf#L7-L33

= changelog =
msg: Use sqlite cache to make bash completion snappier
type: enhancement
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1815895
2022-04-27 15:53:31 +02:00
Oğuz Ersen 5f4f60d5d8 completion: remove unnecessary echo 2022-03-28 09:14:19 +02:00
Miroslav Suchý b4926be01e dnf.conf: hint users where to find more info about defaults and other options 2022-03-17 09:56:15 -04:00
Jan Pokorný 565ccbba08 [completion] fix overboard tilde expansion where tilde check warranted
Apparently, it was never intended for "do we deal with FS-backed
argument?" check to do a possibly problematic[*] prefix check on
the whole home dir path, so get this right and also simplify the
function statement as it makes do without any conditionals.

[*] This is three-fold:
    - first and foremost: whole NSS machinery would be, in accordance
      with Tilde Expansion, hard at work to figure out whether there
      is a '*' user (which is a long shot to say the least), possibly
      even accidentally crashing the process (as happened to me,
      leading to this very fix: https://bugzilla.redhat.com/1929936),
    - then, being entirely redundant (as long as $HOME always resolves
      to the absolute address) with the preceding slash-prefix-check,
      hence a futile work could be performed in a negative case,
    - and finally, not capturing the actual intention of user to
      complete "~/foo.rpm" (package starting with tilde would not
      be offered in the completion as originally intended, IMHO)
2021-04-26 10:51:02 +02:00
Aleš Matěj fef47d3f9c Make rotated log file (mode, owner, group) match previous log settings (RhBug:1894344)
https://bugzilla.redhat.com/show_bug.cgi?id=1894344
2020-11-26 09:51:22 +01:00
Pavla Kratochvilova 4bde54bfe3 Do not handle dnf.librepo.log with logrotate
Since the log rotation for dnf.librepo.log is now handled in python,
there shouldn't be a logrotate config for this log anymore.

= changelog =
related: https://bugzilla.redhat.com/show_bug.cgi?id=1816573
2020-10-26 08:53:26 +01:00
Lukáš Hrázký 829fa0a618 dnf-makecache.timer: Add a randomized delay of one hour
= changelog =
msg: Add a one hour randomized delay to the dnf-makecache.timer
type: enhancement
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1857029
2020-08-21 13:46:28 +02:00
Jason Montleon 7b1f0838cb Use mail -Ssendwait for systemd (RhBug:1862739)
Closes: #1646
Approved by: kontura
2020-08-04 07:29:03 +00:00
zhangrui182 1bdc590546 remove log_lock.pid after reboot(Rhbug:1863006) 2020-08-03 15:46:00 +02:00
Marek Blaha 24fed22d65 [dnf-automatic] New network_online_timeout config option
This options defines maximum time for which dnf-automatic will wait for
system to be on-line.
2020-07-09 10:49:53 +02:00
Nicola Sella d46db8280a Add bash completion for 'dnf module' (RhBug:1565614)
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1565614
2020-03-04 14:44:42 +01:00
Marek Blaha e0d841f8e1 Use WantedBy=timers.target for all dnf timers (RhBug:1798475)
According to systemd.special(7) it is recommended that timer units
installed by applications get pulled in from timers.target unit.

https://bugzilla.redhat.com/show_bug.cgi?id=1798475
2020-02-20 16:49:44 +01:00
Todd Zullinger 46c50233e0 completion: fix path to platform-python (RhBug:1679008)
Running dnf in containers or other minimal systems does not usr nor
require python3.  Yet without /usr/bin/python3, completion does not
work.  This is due to a bad path in the code which checks for the path
to python in _dnf_set_python_exec().

The system-python name was changed to platform-python at some point.
Using dnf completion on a system without python3 should work using the
same python that dnf itself uses, /usr/libexec/platform-python.

Arguably, this path should be set via @PYTHON_EXECUTABLE@ as it is for
bin/dnf for consistency and correctness.
2019-12-28 08:51:16 -05:00
Lukáš Hrázký 0658872e09 dnf-automatic: Change all systemd timers to a fixed time of day (RhBug:1754609)
Changes all systemd timers of the automatic systemd services to start at
6AM with a randomized delay of one hour. This changes the timing so that
it happens at a predictable time every day (before the business hours).

Removes the AccuracySec=1s, the default is one minute. We don't
need a one second accuracy and the higher default is meant to conserve
energy (probably negligible here).

Adds the Persistent=true option so that the time of the last run is
stored on disk and the unit is run as soon as possible if the event
expired while the machine was turned off.

https://bugzilla.redhat.com/show_bug.cgi?id=1754609
2019-11-19 07:33:00 +01:00
Jaroslav Mracek 94288f84e9 Allow to ship alternative dnf.conf (RhBug:1752249)
In fedora and other distribution it is required to ship dnf with
different setting in dnf.conf.

https://bugzilla.redhat.com/show_bug.cgi?id=1752249
2019-10-03 14:32:51 +02:00
Pavla Kratochvilova 5ad2a7693c Do not handle dnf.log, dnf.rpm.log, and dnf.plugin.log with logrotate
Since the log rotation for these logs is handled in python, they shouldn't
be included in the logrotate config anymore.
2019-06-10 12:04:39 +02:00
Marek Blaha f68dcb2f0f [bash completion] Avoid potential hangs in _dnf_show_packages (RhBug:1702854)
This is basically reusing fixes introduced in commit
36bf3730b6
on another place where the bash completion might get stuck.

https://bugzilla.redhat.com/show_bug.cgi?id=1702854

Closes: #1390
Approved by: Conan-Kudo
2019-05-03 05:13:32 +00:00
Neal Gompa 3fabc82821 CMake: Actually install aliases
With the introduction of a default set of aliases in da52d0ee8e,
we are supposed to install the alias files. However, the change was incomplete.

This fixes the installation of those aliases.
2019-04-23 08:04:58 -04:00
Pavla Kratochvilova da52d0ee8e Add command abbreviations (RhBug:1634232)
https://bugzilla.redhat.com/show_bug.cgi?id=1634232
These aliases were removed by commit 359f95a4f4
For each command, only one alias is added, the rest is put into aliases
config that is not included by default.
2019-04-18 15:37:12 +02:00
Jaroslav Mracek 3ccabe34ee Add protection of yum package (RhBug:1639363)
https://bugzilla.redhat.com/show_bug.cgi?id=1639363
2019-03-07 14:10:04 +01:00
Jaroslav Mracek a07c124b4a Add best as default behavior (RhBug:1670776,1671683)
The new default behavior should provide a better security.

https://bugzilla.redhat.com/show_bug.cgi?id=1670776
https://bugzilla.redhat.com/show_bug.cgi?id=1671683
2019-02-05 14:35:20 +01:00
Marek Blaha 6275b768f0 [automatic] Fix the systemd ordering loop (RhBug:1636480)
This basically only applies theses patches also on dnf-automatic-*
timers and services:

* d1f4da94 - move the ordering after network to .service
* 4ca1555a - move to multi-user

https://bugzilla.redhat.com/show_bug.cgi?id=1636480
2018-10-24 15:16:17 +02:00
Peter Oliver 742db55f2c Randomise start time via systemd timers
By moving the randomised delay from `dnf-automatic` to the systemd timers that call `dnf-automatic`, we get more accurate information from `systemctl list-timers`, and we allow `dnf-automatic` to be triggered immediately with, e.g., `systemctl start dnf-automatic-install.service`
2018-10-23 09:46:26 +02:00
Zbigniew Jędrzejewski-Szmek d1f4da949d dnf-makecache.timer: move the ordering after network to .service
The timer does not need the network. The service needs it. Move the
After=network-online.target line to the service file. Wants=network-online.target
is still in .timer, which means that the network-online.target and services that
implement it will be pulled in from the .timer and started eagerly. But there is
no ordering, so they only need to finish before the .service is started.

Keeping the ordering dependency between timer and network-online.target means
that network-online.target is ordered before multi-user.target, which is wrong,
because it delays multi-user.target for no good reason.

This patch changes the ordering so that the service will be started
{10 minutes after boot} or when the network is available, whatever is
later, and not 10 minutes after {the network is available and the
boot is finished, whatever is later}.

Tested by running an affected system without AdamWill's patch but with this patch,
and confirming that the ordering loop is gone. (AdamWill's patch is correct on its
own, because putting this timer and the associated service in basic.target is
bonkers.)

Follow-up for 3144280dc7.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2018-08-31 13:12:42 +02:00
Adam Williamson 4ca1555ab6 dnf-makecache.timer: move to multi-user to fix loop
In ee96304, `After=network-online.target` was added to the
dnf-makecache.timer service definition. However, it was already
`WantedBy=basic.target`. These two requests are contradictory
in Fedora and probably most distributions, as it seems that
network-online.target requires NetworkManager.service, and
NetworkManger.service requires basic.target. systemd is forced
to break this loop somehow: my testing suggests that it usually
does so by throwing dnf-makecache.timer out of the process, but
sometimes does it by throwing NetworkManager out of the process,
resulting in the network unexpectedly not coming up. See
https://bugzilla.redhat.com/show_bug.cgi?id=1600823 for more.

This commit resolves this simply having dnf-makecache.timer
WantedBy multi-user.target, not basic.target. I don't think we
*really* want DNF refreshing its caches in what is basically a
recovery environment, after all, and NetworkManager itself is
WantedBy multi-user.target, so if you actually only boot to
basic.target, there is no network up at all after boot (I've
tested this).

There are other options (e.g. dropping the After network-online
ordering and just trusting the Wants and the ten-minute startup
delay to be sufficient), but we certainly should resolve this
one way or another.

Resolves: rhbz#1600823

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-07-16 15:04:29 +02:00
Peter Oliver 27a4c9de23 Align systemd config with documented options 2018-06-25 08:08:06 +02:00
Todd Zullinger dd133ab1fb completion: split dnf_commands_helper() command and options
The completion helper command is a bit long.  Split the command and
options into local variables to improve readability.

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Todd Zullinger 36bf3730b6 completion: avoid potential hangs in dnf_commands_helper()
The completion helper can hang indefinitely waiting for user input
(which the user cannot see).  The --assumeno option ensures any prompts
are answered negatively.

Using the --nogpgcheck option avoids the helper downloading gpgkeys for
repos which have repo_gpgcheck=1 set.  This can speed up the completion
quite a bit.

Lastly, redirect input from /dev/null to ensure the completion_helper
command knows it has no controlling tty on which to wait for input.

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak b49980abef Generate list of functions for completion directly
This should speed up the generation of the package list list a little bit.

Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak fe2ce77f98 Improve list and info autocompletion (RhBug:1270295)
dnf list pe TabTab wasn't auto-completing packages. It will now
suggest installed or available packages.

Autocompletion for dnf list installed/available will only suggest installed/available
packages onwards.

https://bugzilla.redhat.com/show_bug.cgi?id=1270295

Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak d171d5f1d6 Improve bash-completions for options
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak a28f8d407b Fix completion of history subcommands (RhBug:1361698)
https://bugzilla.redhat.com/show_bug.cgi?id=1361698

Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak 0c15a64865 Change behavior of completion for reinstall (RhBug:1369847)
Bash completion for reinstall should show only installed packages.
https://bugzilla.redhat.com/show_bug.cgi?id=1369847

Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Martin Kutlak e6b1857062 Fix completion not working after first option (RhBug:1368651)
https://bugzilla.redhat.com/show_bug.cgi?id=1368651

Signed-off-by: Martin Kutlak <mkutlak@redhat.com>

Closes: #894
Approved by: m-blaha
2018-05-30 09:12:43 +00:00
Štěpán Smetana ee96304922 fixup! fixup! Dnf timers should require systemd network target(RhBug:1247083) 2017-12-01 16:26:17 +01:00