Bug 919769
| Summary: | dnf runs makecache hourly despite laptop power state | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | William Brown <william> |
| Component: | dnf | Assignee: | Ales Kozumplik <akozumpl> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 18 | CC: | akozumpl, jzeleny |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | dnf-0.3.1 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-03-26 15:27:20 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
(In reply to comment #0) > Additionally, hourly rebuilds are > quite aggressive, this should be daily. Please see bug 892064 for this particular issue. The time to check for expired metadata has been increased to 3 hours. That doesn't mean they are redownloaded and the cache rebuilt every three hours, only when the metadata actually expire (which is even as little as 6 hours for some repos, with notable example of Fedora Updates). > The script should be more like 0anacron in that:
>
> #! /bin/bash
>
> # Do not run jobs when on battery power
> if test -x /usr/bin/on_ac_power; then
> /usr/bin/on_ac_power &> /dev/null
> if test $? -eq 1; then
> exit 0
> fi
> fi
>
> LOGFILE=/var/log/dnf-makecache.cron
> STAMP=`date +%c`:
> echo $STAMP >>$LOGFILE
> /usr/bin/dnf makecache >>$LOGFILE
Fixed by 04d030a, the automatic metadata syncing will never run whenver on a battery system, starting with dnf-0.3.1.
Thanks for the report and a nice tip towards a solution (didn't know about 'on_ac_power').
|
Description of problem: dnf has a cron job in: /etc/cron.hourly/dnf-makecache.cron The runs a makecache hourly. On a laptop system this is quite draining. Additionally, hourly rebuilds are quite aggressive, this should be daily. The script should be more like 0anacron in that: #! /bin/bash # Do not run jobs when on battery power if test -x /usr/bin/on_ac_power; then /usr/bin/on_ac_power &> /dev/null if test $? -eq 1; then exit 0 fi fi LOGFILE=/var/log/dnf-makecache.cron STAMP=`date +%c`: echo $STAMP >>$LOGFILE /usr/bin/dnf makecache >>$LOGFILE