Bug 1220182 - [plugins] Support post-transaction actions
Summary: [plugins] Support post-transaction actions
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugins-extras
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Gnatenko
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-10 23:11 UTC by Jeremy Fitzhardinge
Modified: 2016-07-07 09:40 UTC (History)
20 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 967264
Environment:
Last Closed: 2016-07-07 09:40:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 967264 0 unspecified CLOSED [plugins] Support post-transaction actions 2023-10-06 17:26:36 UTC

Internal Links: 967264

Description Jeremy Fitzhardinge 2015-05-10 23:11:55 UTC
+++ This bug was initially created as a clone of Bug #967264 +++

Description of problem:
yum has a plugin for doing some actions after a transaction is finished which is IMHO very useful. Please add support for those post-transaction actions to dnf.
DNF now has a plugin API, which allows this to be implemented.

--- Additional comment from Ales Kozumplik on 2013-05-27 03:28:41 EDT ---

DNF doesn't yet provide a plugin API so that should come first. Leaving this open until then, shouldn't be a problem.

--- Additional comment from Ales Kozumplik on 2013-12-06 05:00:08 EST ---



--- Additional comment from Ales Kozumplik on 2013-12-06 10:25:46 EST ---

Fixed by 6e60010 on master, the new API will be included in dnf-0.4.10.

--- Additional comment from Fedora Update System on 2014-01-02 05:09:29 EST ---

dnf-0.4.10-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dnf-0.4.10-1.fc20

--- Additional comment from Fedora Update System on 2014-01-03 03:41:12 EST ---

Package dnf-0.4.10-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.4.10-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0089/dnf-0.4.10-1.fc20
then log in and leave karma (feedback).

--- Additional comment from Fedora Update System on 2014-01-04 14:52:53 EST ---

dnf-0.4.10-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from Lauren on 2015-04-23 21:03:16 EDT ---

Ales,

This bug should be re-opened, as the request for a dnf equivalent to yum-plugin-post-transaction-action has not been fulfilled, only the first step towards that goal (support for plugins in dnf) has been addressed thus far.

--- Additional comment from Lauren on 2015-04-23 21:05:16 EDT ---

Typo -- the correct name for the package is yum-plugin-post-transaction-actions (with an "s" at the end)

Comment 1 Radek Holy 2015-05-12 08:23:54 UTC
I think that this plugin should rather go into the community plugins since implementing a custom DNF plugin is a more powerful and an already supported way to satisfy the use cases of the requested plugin.

Comment 2 Igor Gnatenko 2015-05-12 14:41:08 UTC
I fully agree. Dnf supports post a transaction hook. It doesn't support pre-transaction.

Let me know what do you want from plugin. I will implement it.

Comment 3 Lauren 2015-07-22 17:35:22 UTC
Igor,

We're just looking for the ability to configure arbitrary commands to run after certain packages are acted on.

For yum this was implemented in yum-plugin-post-transaction-actions ... if this were re-implemented for dnf, I think everyone would be happy, but I doubt anyone needs it to be implemented in exactly the same way (particularly because it doesn't seem to be very well documented), so long as it can accomplish the same thing.

Here's the description of yum-plugin-post-transaction-actions:
Yum plugin to run arbitrary commands when certain pkgs are acted on
This plugin allows the user to run arbitrary actions immediately following a transaction when specified packages are changed.

My understanding is that it creates a directory at /etc/yum/post-actions ... in that directory, a user could place "action" files for each package the user wishes to have post transaction actions apply to (e.g., the user could create a file named kernel.action if they want to run a command after the kernel is updated (actually, I don't think it matters what the file name is, as long as it ends in ".action", since the package name must be specified inside the file)) ... inside the file the user would enter the package name, an action (e.g. install or update), and the path to a script to run, like follows ...
kernel:update:/path-to/script-to-run.sh

In this case, the script will run any time the kernel package is updated.

You can also pass variables such as the package version to the script, like follows ...
kernel:update:/path-to/script-to-run.sh $ver $rel $arch

Comment 4 Freddy Willemsen 2015-12-09 10:06:28 UTC
Is anybody working on this by chance? I personally think this is a big omission in DNF. I love its speed but when it comes to functionality I still prefer yum at this moment.

Comment 5 Igor Gnatenko 2015-12-12 19:32:06 UTC
I am starting to work on it.

Comment 6 Freddy Willemsen 2015-12-14 11:32:17 UTC
Thanks, really appreciate any effort.

Comment 7 Freddy Willemsen 2016-07-04 11:31:19 UTC
Any updates on this functionality? It does not appear to be included in F24 ..

Comment 8 Igor Gnatenko 2016-07-07 09:38:41 UTC
(In reply to Freddy Willemsen from comment #7)
> Any updates on this functionality? It does not appear to be included in F24
> ..

unfortunately not yet.

Comment 9 Igor Gnatenko 2016-07-07 09:40:54 UTC
Lets track in upstream: https://github.com/rpm-software-management/dnf-plugins-extras/issues/63


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