Bug 1109927 - RFE: take systemd inhibitor lock while doing operations that shouldn't be interrupted by shutdown
RFE: take systemd inhibitor lock while doing operations that shouldn't be int...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-16 11:55 EDT by Matthew Miller
Modified: 2016-01-12 19:33 EST (History)
14 users (show)

See Also:
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 04:53:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthew Miller 2014-06-16 11:55:24 EDT
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 00:54:14 EDT
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 08:47:30 EDT
(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 09:22:29 EDT
(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 03:36:40 EDT
Great, moving to RPM.
Comment 5 Matthew Miller 2014-06-23 10:01:04 EDT
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 07:48:34 EDT
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-18 20:54:40 EDT
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 01:37:02 EDT
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 01:51:57 EDT
(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 02:05:37 EDT
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 03:26:48 EDT
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 16:51:21 EDT
DNF in the upstream requires rpm-plugin-systemd-inhibit. Thanks, Panu.
Comment 13 Fedora Update System 2014-12-09 09:06:34 EST
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-11 23:32:39 EST
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 04:53:40 EST
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.

Note You need to log in before you can comment on or make changes to this bug.