Bug 1246631 - [RFE] Support RPMCALLBACK_SCRIPT_{START,STOP,ERROR}
Summary: [RFE] Support RPMCALLBACK_SCRIPT_{START,STOP,ERROR}
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1246600
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-24 17:36 UTC by Will Woods
Modified: 2017-04-10 16:13 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-04-10 16:12:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1419311 0 unspecified CLOSED dnf update hung forever 2021-02-22 00:41:40 UTC

Internal Links: 1419311

Description Will Woods 2015-07-24 17:36:37 UTC
DNF doesn't provide any progress reporting during scriptlets; if you have a long-running %post or %posttrans scriptlet DNF just seems to hang.

RPM sends callback events for scriptlets (RPMCALLBACK_SCRIPT_{START,STOP,ERROR} - see http://rpm.org/api/4.12.0.1/rpmcallback_8h.html).

dnf.yum.rpmtrans.RPMTransaction handles these in callback(), but it never passes them along to the TransactionDisplay object:

    def _scriptStart(self, bytes, total, h):
        pass

    def _scriptStop(self, bytes, total, h):
        self._scriptout()

I've asked the RPM maintainers to document these callbacks and their behavior - see bug 1246600 for details.

Once that documentation exists, I suggest that DNF should add new actions (and/or a new function) to TransactionDisplay so RPMTransaction can send display events in _scriptStart and/or _scriptStop.

Obviously it's not possible to get te_current/te_total for scriptlets as we use them now, but it *might* be possible to count each type of scriptlet in the transaction, which would at least let us provide feedback during %posttrans:

   "[%s/%s] Running post-transaction scriptlet for %s" % (current, total, pkg)

(This is especially important for system upgrades - there have been a *lot* of reports of people resetting their system in the middle of an upgrade because selinux-policy %post was taking several minutes to complete, and they assumed their system had crashed. The results are usually pretty nasty.)

Comment 1 Fedora Admin XMLRPC Client 2016-07-08 09:35:00 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Fedora End Of Life 2016-11-24 12:14:52 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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.

Comment 3 Michael Mráka 2016-11-30 08:49:30 UTC
Still valid in dnf-2.0.0-0.rc1.4.fc26.noarch.

Comment 4 Jaroslav Mracek 2017-04-10 16:12:58 UTC
We now provides information about scriplets start. This is valid for dnf-2.3.0-1 that was released into rawhide and it is in testing for Fedora 26. The latest versions we provide for fc24+ from our test repository ("dnf copr enable rpmsoftwaremanagement/dnf-nightly").

Comment 5 Jaroslav Mracek 2017-04-10 16:13:56 UTC
Please if our solution is insufficient for you don't hesitate to reopen the bug report.


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