Bug 1287559 - triggers with satisfied conditions don't get run
triggers with satisfied conditions don't get run
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
23
All Linux
unspecified Severity urgent
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Regression
Depends On: 702378
Blocks: 1246911
  Show dependency treegraph
 
Reported: 2015-12-02 05:51 EST by Yin.JianHong
Modified: 2016-10-12 10:30 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 702378
Environment:
Last Closed: 2016-10-12 10:30:39 EDT
Type: ---
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 Yin.JianHong 2015-12-02 05:51:34 EST
+++ This bug was initially created as a clone of Bug #702378 +++

Description of problem:
From a collection of triggers of a same type (triggerun) that should
be set off, only one gets run.

Version-Release number of selected component (if applicable):
rpm-4.9.0-7.fc16.x86_64
rpm-build-4.9.0-7.fc16.x86_64.rpm

How reproducible:
always

Steps to Reproduce:
Reproduced on F16, upgrading from one version of a package to a higher
version, both with simple spec files:

=== trgtst-1.1 spec ===
Name:           trgtst
Version:        1.1
<...>

=== trgtst-1.5 spec ===
Name:           trgtst
Version:        1.5
<...>
%triggerun -- trgtst < 1.2
echo "foo1"
%triggerun -- trgtst < 1.3
echo "foo2"
%triggerun -- trgtst < 1.4
echo "foo3"
%triggerun -- trgtst < 1.5
echo "foo4"
<...>

# rpm -i ~/rpmbuild/RPMS/x86_64/trgtst-1.1-1.fc16.x86_64.rpm
# rpm -U ~/rpmbuild/RPMS/x86_64/trgtst-1.5-1.fc16.x86_64.rpm
foo1

Actual results:
triggers with satisfied conditions don't get run.

Expected results:
All triggers that have met their conditions are executed.

--- Additional comment from Michal Schmidt on 2011-05-06 17:56:57 EDT ---

This could be the cause of some services not being enabled after an upgrade from F14 to F15, such as bug 699198.

--- Additional comment from Panu Matilainen on 2011-05-13 07:46:51 EDT ---

This is the intended and expected behavior (from rpm POV): only a single trigger is executed per each trigger target <-> source pair in a transaction.

--- Additional comment from Michal Schmidt on 2011-05-13 08:06:03 EDT ---

Panu,
could you please take a look at the three %triggerun scriptlets in rsyslog.spec?:

http://pkgs.fedoraproject.org/gitweb/?p=rsyslog.git;a=blob;f=rsyslog.spec;h=86ac99230748e4d8ead1b5933c3685ce12d06e0e;hb=refs/heads/master#l211

Can you suggest a working way to achieve what it's trying to do?

The package maintainers do not seem to be aware of this limitation of RPM triggers. See NetworkManager.spec for another example. I'm sure there are more.

--- Additional comment from Panu Matilainen on 2011-05-13 08:14:57 EDT ---

Right, I'll have a look and comment on the rsyslog bug.

Oh and FWIW, of course it would be technically possible to change rpm behavior wrt triggers, but it would introduce a problematic backs-compatibility quirk that can't be (AFAICS) automatically tracked by rpm. And without tracking, it would cause packages to behave rather differently depending on which rpm version they happen to get installed with (eg Koji runs on an older rpm version than what F15 has etc)

--- Additional comment from Marcela Mašláňová on 2011-10-17 07:59:46 EDT ---

Ok, I agree that change of behaviour would be problematic. But could you add something which will complain during build? I wasn't aware that I can't use more than one triggerun in specfile. Warning might be enough.

--- Additional comment from Michal Schmidt on 2012-06-14 11:33:11 EDT ---

Is there any solution in sight for this bug?
Today yet another packager stepped into the multiple triggers trap:
http://lists.fedoraproject.org/pipermail/devel/2012-June/168608.html
It really is not obvious to packagers that multiple triggers on the same package do not work.

--- Additional comment from Fedora End Of Life on 2012-08-07 16:02:11 EDT ---

This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached 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 to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

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.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from Tomas Heinrich on 2012-11-21 08:24:42 EST ---

Is there any progress on this?
A build-time check would be nice or at least a note in the documentation.

--- Additional comment from Fedora End Of Life on 2013-04-03 15:39:06 EDT ---

This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

--- Additional comment from Fedora End Of Life on 2015-01-09 16:49:05 EST ---

This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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

--- Additional comment from Tomas Heinrich on 2015-01-12 11:06:10 EST ---

Can somebody, at least, add a short note to /usr/share/doc/rpm/triggers ?

--- Additional comment from Ľuboš Kardoš on 2015-03-20 09:28:18 EDT ---

Fixed in upstream. Command rpmbuild now complain about multiple triggers triggered by the same package in one spec file.

--- Additional comment from Tomas Heinrich on 2015-03-20 10:02:25 EDT ---

(In reply to Ľuboš Kardoš from comment #12)
> Fixed in upstream. Command rpmbuild now complain about multiple triggers
> triggered by the same package in one spec file.

Thanks.

I guess it wouldn't hurt if rpmlint also complained.
I'll open a new bug.
Comment 1 Yin.JianHong 2015-12-02 05:54:09 EST
[yjh@dhcp12-109 nfs-utils]$ LANG=C rhpkg --dist rhel-7.2 srpm
error: line 352: Trigger fired by the same package is already defined in spec file: %triggerin -- nfs-utils < 1:1.3.0-0.2

error: query of specfile /home/yjh/ws/code.repo/nfs-utils/nfs-utils.spec failed, can't parse

Could not execute srpm: Could not get n-v-r-e from ''



* There's no this problem in Fedora 22
Comment 2 Panu Matilainen 2016-10-12 10:30:39 EDT
(In reply to Yin.JianHong from comment #1)
> [yjh@dhcp12-109 nfs-utils]$ LANG=C rhpkg --dist rhel-7.2 srpm
> error: line 352: Trigger fired by the same package is already defined in
> spec file: %triggerin -- nfs-utils < 1:1.3.0-0.2

That's not really what this bug is about. Reopen bug 1247140 if you think its necessary to revise that behavior, I probably could be convinced to turn it into a warning on the grounds that its not that rare for people to work on older packages on a newer rpm.

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