[Rpm-maint] [rpm-software-management/rpm] Signal Handling (Discussion #3150)
Neale Ferguson
notifications at github.com
Thu Jun 6 19:34:06 UTC 2024
If I establish signal handlers prior to invoking an RPM function then when I return from that function the signal handlers are no longer "active". For example,
```
import rpm
import sys
import signal
def signal_handler(__signo, __stack):
print("Signaled")
sys.exit(1)
signal.signal(signal.SIGTERM, signal_handler)
ti = rpm.TransactionSet()
mi = ti.dbMatch("name", "docker-ce")
for h in mi:
print(h)
break
signal.signal(signal.SIGTERM, signal_handler)
while True:
pass
```
If I move the `signal.signal(...` to before the `while` loop then it works as expected.
I installed `rpm` via `pip3 install rpm`.
Is there a call I should be making to clean up the RPM environment that would restore my signal handler?
Thanks... Neale
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/3150
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/3150 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240606/975ff83b/attachment.html>
More information about the Rpm-maint
mailing list