Description of problem: My home server which is definitely plugged in, gets this message from dnf makecache timer: Metadata timer caching disabled when running on a battery. While it is on a UPS, the UPS is not connected to the computer. Investigation with strace shows that it is this that causes the battery message: open("/sys/class/power_supply/hidpp_battery_0/online", O_RDONLY) = 3 That "hidpp" device is a Logitech wireless keyboard and mouse. $ cat /sys/class/power_supply/hidpp_battery_0/model_name Wireless Touch Keyboard K400 Version-Release number of selected component (if applicable): dnf-2.6.3-12.fc26.noarch unifying-receiver-udev-0.2-8.fc26.noarch How reproducible: Happens every hour. Steps to Reproduce: 1. Have dnf and unifying-receiver-udev installed. 2. Connect a Logitech K400 3. Run "dnf makecache timer" Actual results: Metadata timer caching disabled when running on a battery. Expected results: DNF package cache updated. Additional info: The documentation and "dnf makecache --help" are both wrong about the timer option. Both claim it is "dnf makecache --timer" but that does not work. The systemd unit calls it as "dnf makecache timer" no double-dashes.
This message is a reminder that Fedora 26 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '26'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 26 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle. Changing version to '29'.
Please can anyone reproduce the issue with latest dnf (4.0.9)?
I create a patch that changed the detection - https://github.com/rpm-software-management/dnf/pull/1439. The previous detection was based on call /usr/bin/on_ac_power that is not on the systems.
Neither one of my two Linux desktop systems has a /sys/class/power_supply/AC directory. I don't think that this will work. Now, the laptop does have an AC directory. Perhaps if you assume AC power unless the AC directory is present AND set to 0?
I believe that the implementation is is correct. Def on_ac_power() returns True (on AC), False (on battery), None (Unable to detect). Then usage in code is like: `dnf.util.on_ac_power() is False:` It means that when None is returned it assumes that it is not on battery.
The patch was release in dnf-4.2.11 in Fedora 30