RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1913765 - Signal delivery within scriptlets is blocked
Summary: Signal delivery within scriptlets is blocked
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rpm
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 8.0
Assignee: Michal Domonkos
QA Contact: Eva Mrakova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-07 14:38 UTC by Welterlen Benoit
Modified: 2024-10-01 17:16 UTC (History)
5 users (show)

Fixed In Version: rpm-4.14.3-11.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:49:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
Patch that add SIGALRM from the excluded blocked signals (554 bytes, application/mbox)
2021-01-07 14:38 UTC, Welterlen Benoit
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5867201 0 None None None 2021-03-09 01:58:25 UTC

Description Welterlen Benoit 2021-01-07 14:38:01 UTC
Created attachment 1745317 [details]
Patch that add SIGALRM from the excluded blocked signals

Created attachment 1745317 [details]
Patch that add SIGALRM from the excluded blocked signals

Created attachment 1745317 [details]
Patch that add SIGALRM from the excluded blocked signals

Created attachment 1745317 [details]
Patch that add SIGALRM from the excluded blocked signals

Description of problem:
If an alarm is needed in one of the script in the RPM, it will be ignored because of the blocked signals.
For example, if you use flock with -w, the alarm after the timeout will never be received:
%pre
flock -x -w 19 /tmp/lock sleep 99

Version-Release number of selected component (if applicable):
rpm-4.14.3-4

How reproducible:
always

Steps to Reproduce:
1. add a script that needs an alarm, example flock -w <timeout>
2. 
3.

Actual results:
- the alarm from the timeout is not received

Expected results:
- flock interrupted

Additional info:
- I already opened a pull request upstream: https://github.com/rpm-software-management/rpm/pull/1479
- attached patch, tested on RHEL8.3
- http://brew-task-repos.usersys.redhat.com/repos/scratch/bwelterl/rpm/4.14.3/4.el8/

Acceptance criteria:

Signals within scriptlets (e.g. %pre) work as expected - that is, signals like SIGALRM or SIGINT are received by the scriptlets (or the subprocesses they run).

As a (manual) reproducer, one can use the %pre example from above, while running flock on the same file but from a different shell.

With the fixed RPM version, the %pre script would unblock after -w seconds and make RPM fail with exit code 1 and an error message saying the %pre scriptlet failed.  With the current (unfixed) RPM version, the %pre script should eventually finish, install the package and exit with code 0.

Note that this is subject to race conditions, though, so could be hard to automate reliably...

You can also test this with SIGINT instead, e.g. make the %pre scriptlet block and then try pressing CTRL-C.  With the fix, it should receive the signal and interrupt the RPM transaction.

Comment 2 Panu Matilainen 2021-01-12 12:10:03 UTC
Upstream fix proposal: https://github.com/rpm-software-management/rpm/pull/1486

Comment 13 errata-xmlrpc 2021-05-18 14:49:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rpm bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1606


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