Bug 878826
Summary: | [rfe] dnf could use systemd timer unit rather than crontabs | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Harald Hoyer <harald> | ||||
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, marcosfrm | ||||
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-25 14:09:51 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: | |||||||
Bug Depends On: | 879597 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Harald Hoyer
2012-11-21 10:35:38 UTC
$ systemctl status dnf-makecache.timer dnf-makecache.timer - dnf makecache timer Loaded: loaded (/etc/systemd/system/dnf-makecache.timer; disabled) Active: active (waiting) since Wed, 2012-11-21 11:31:10 CET; 6min ago $ systemctl status dnf-makecache.service dnf-makecache.service - dnf makecache Loaded: loaded (/etc/systemd/system/dnf-makecache.service; static) Active: inactive (dead) since Wed, 2012-11-21 11:30:10 CET; 8min ago Main PID: 3779 (code=exited, status=0/SUCCESS) CGroup: name=systemd:/system/dnf-makecache.service Nov 21 11:30:09 lenovo systemd[1]: Starting dnf makecache... Nov 21 11:30:10 lenovo dnf[3779]: Metadata Cache Created Nov 21 11:30:10 lenovo systemd[1]: Started dnf makecache. $ sudo journalctl _SYSTEMD_UNIT=dnf-makecache.service -- Logs begin at Thu, 2012-07-19 10:37:56 CEST, end at Mon, 2012-09-10 11:09:10 CEST. -- Nov 21 09:30:10 lenovo dnf[3761]: Metadata Cache Created Nov 21 10:30:10 lenovo dnf[3772]: Metadata Cache Created Nov 21 11:30:10 lenovo dnf[3779]: Metadata Cache Created Hi Harald, thanks for the report, I had no idea that this is how the repeating tasks are done now. I've got quite a lot of things to do on DNF right now, so your patch helps a lot. One question: [Timer] OnBootSec=10min OnUnitInactiveSec=1h Unit=dnf-makecache.service Does this mean that makecache will run 10 minutes after every boot and then every hour? Also (and I have been wondering about how to do this for some time): could there be a timer item to specify the required network service level, e.g.: [Timer] ... NetworkServiceAtLeast=Ethernet Because if people are connected via their crazy expensive 3G (and NetworkManager should have this information) I can imagine they are not cool about package manager updating itself every hour. (In reply to comment #2) > Hi Harald, thanks for the report, I had no idea that this is how the > repeating tasks are done now. I've got quite a lot of things to do on DNF > right now, so your patch helps a lot. One question: > > [Timer] > OnBootSec=10min > OnUnitInactiveSec=1h > Unit=dnf-makecache.service > > Does this mean that makecache will run 10 minutes after every boot and then > every hour? yes $ man systemd.timer OnBootSec= defines a timer relative to when the machine was booted up. > > Also (and I have been wondering about how to do this for some time): could > there be a timer item to specify the required network service level, e.g.: > > [Timer] > ... > NetworkServiceAtLeast=Ethernet > > Because if people are connected via their crazy expensive 3G (and > NetworkManager should have this information) I can imagine they are not cool > about package manager updating itself every hour. Well, this has to be resolved via other mechanisms than systemd. systemd does not know the current network state. Maybe this cache polling should be removed entirely? > Well, this has to be resolved via other mechanisms than systemd. systemd
> does not know the current network state.
>
> Maybe this cache polling should be removed entirely?
I don't think it would be a good thing to start dropping components' functionalities just to make them fit into the systemd's scheme of things.
(In reply to comment #4) > > Well, this has to be resolved via other mechanisms than systemd. systemd > > does not know the current network state. > > > > Maybe this cache polling should be removed entirely? > > I don't think it would be a good thing to start dropping components' > functionalities just to make them fit into the systemd's scheme of things. Well, the dropping suggestions was not based on systemd's functionality but your own argument "if people are connected via their crazy expensive 3G". Even NetworkManager cannot know, if your laptop is connected to your mobile hotspot via WLAN. (In reply to comment #5) > Even NetworkManager cannot know, if your laptop is connected to your mobile > hotspot via WLAN. Easy, add a checkbox in the NM WLAN dialog that says 'Minimize maintenance traffic through this network.' We'll need it anyway at some point---for instance most other synchronization tasks like backups. I opened the systemd bug 879370 for this. Related: bug 878826. Created attachment 684945 [details]
Jochen Schmitt's patch for the RFE
Addressed by commit 878826, will be included in dnf-0.3.1. The cron file stays in the repo but only the systemd .timer file is packaged for Fedora. The custom ABRT collector stays broken, bug 879597. Nit: the "Unit=" line is optional in the .timer file if it has the same basename of the .service. "For each timer file, a matching unit file must exist, describing the unit to activate when the timer elapses. By default, a service by the same name as the timer (except for the suffix) is activated. Example: a timer file foo.timer activates a matching service foo.service. The unit to activate may be controlled by Unit= (see below)." http://www.freedesktop.org/software/systemd/man/systemd.timer.html Hi Marcos, if you prefer the service file without the Unit= line please open a new bugzilla, this one has been long closed. Thank you. |