Bug 1109927

Summary: RFE: take systemd inhibitor lock while doing operations that shouldn't be interrupted by shutdown
Product: [Fedora] Fedora Reporter: Matthew Miller <mattdm>
Component: dnfAssignee: Honza Silhan <jsilhan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akozumpl, drago01, jsilhan, jzeleny, novyjindrich, packaging-team-maint, pknirsch, pmatilai, pnemade, rdieter, rholy, samuel-rhbugs, s.kieske, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-0.6.3-2.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-13 09:53:40 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:

Description Matthew Miller 2014-06-16 15:55:24 UTC
If installing and or removing packages is interrupted, the system can be left in a bad state. DNF should take a systemd shutdown inhibitor delay lock (see http://www.freedesktop.org/wiki/Software/systemd/inhibit) when doing anything that can't safely be interrupted.

Comment 1 Panu Matilainen 2014-06-17 04:54:14 UTC
Rpm >= 4.12 has a plugin to do this on rpm level so it shouldn't be necessary to add it to DNF. Doing it doubly shouldn't hurt anything though.

Comment 2 Matthew Miller 2014-06-17 12:47:30 UTC
(In reply to Panu Matilainen from comment #1)
> Rpm >= 4.12 has a plugin to do this on rpm level so it shouldn't be
> necessary to add it to DNF. Doing it doubly shouldn't hurt anything though.

Panu, how does one activate that plugin?

Comment 3 Panu Matilainen 2014-06-18 13:22:29 UTC
(In reply to Matthew Miller from comment #2)
> Panu, how does one activate that plugin?

You dont, as rpm >= 4.12 is not released yet :) Plugin configuration details is actually one of the final pieces holding that back, so the answer is "not entirely clear yet". But eventually I suppose that'd be simply a matter of having the appropriate plugin package installed, and probably such a package should get installed by default on normal systems.

Comment 4 Ales Kozumplik 2014-06-23 07:36:40 UTC
Great, moving to RPM.

Comment 5 Matthew Miller 2014-06-23 14:01:04 UTC
Moving this to RPM might be okay, but we're still left with the question of how it should be activated. Possibly the DNF packages should require the plugin?

Comment 6 Panu Matilainen 2014-08-18 11:48:34 UTC
Now that rpm 4.12 (prerelease) is in f21/f22... the plugin is activated by simply installing it and I'd think that's how we want to keep it. So, how to actually pull it in?

Dnf could require the plugin (rpm-plugin-systemd-inhibit), or another possibility could be just adding the plugin to comps at a suitable spot to avoid creating a hard dependency for something that isn't *strictly* needed. If/when weak dependencies are permitted in Fedora and dnf & friends look at them, we can probably just have rpm itself soft-require it.

Comment 7 Matthew Miller 2014-08-19 00:54:40 UTC
Maybe in the meantime it should just be added to the standard group in comps? (Or maybe even core?)

Comment 8 Panu Matilainen 2014-08-19 05:37:02 UTC
Standard group in comps seems reasonable to me, core is a bit much as it drags in dbus ... except that core already drags in dbus, so it doesn't actually matter.

Comment 9 drago01 2014-08-19 05:51:57 UTC
(In reply to Panu Matilainen from comment #8)
> Standard group in comps seems reasonable to me, core is a bit much as it
> drags in dbus ... except that core already drags in dbus, so it doesn't
> actually matter.

Well systemd uses dbus so you cannot really have a system without dbus. The issue with only adding it to comps is that people that upgrade from a previous fedora release wont get it.

Given that there is hardly any reason to remove it (diskspace?) I'd say just have something depend on it.

Comment 10 Panu Matilainen 2014-08-19 06:05:37 UTC
Ah, I keep forgetting systemd. Still there are the cases like containers and other chroot-cases where you dont have systemd either so dragging in the plugin and dbus would be pointless anyway, and the "minimalist" folks would complain. So... we'd actually want to have it installed whenever systemd is, but having systemd require is just completely wrong too. Can't be correctly expressed with good ol' requires.

Comment 11 Panu Matilainen 2014-10-01 07:26:48 UTC
A simple and effective solution (covering updates and all) is to have dnf require rpm-plugin-systemd-inhibit, reassigning back to dnf. Just remember this is only available in Fedora >= 21.

Comment 12 Honza Silhan 2014-10-05 20:51:21 UTC
DNF in the upstream requires rpm-plugin-systemd-inhibit. Thanks, Panu.

Comment 13 Fedora Update System 2014-12-09 14:06:34 UTC
dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21

Comment 14 Fedora Update System 2014-12-12 04:32:39 UTC
Package dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.6.3-2.fc21 hawkey-0.5.2-1.fc21 dnf-plugins-core-0.1.4-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-16760/dnf-0.6.3-2.fc21,dnf-plugins-core-0.1.4-1.fc21,hawkey-0.5.2-1.fc21
then log in and leave karma (feedback).

Comment 15 Fedora Update System 2014-12-13 09:53:40 UTC
dnf-0.6.3-2.fc21, hawkey-0.5.2-1.fc21, dnf-plugins-core-0.1.4-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.