From 0ff3d1de33af34c45cb2f18adf831cf51b367904 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 1 Jan 2015 21:13:17 -0500 Subject: [PATCH] [libhif] Exit again on SIGINT/SIGTERM A major (if not the biggest) point of this endeavor is to support atomic/idempotent operation. --- src/rpmostree-compose-builtin-tree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpmostree-compose-builtin-tree.c b/src/rpmostree-compose-builtin-tree.c index 1775a1bd..927974d8 100644 --- a/src/rpmostree-compose-builtin-tree.c +++ b/src/rpmostree-compose-builtin-tree.c @@ -160,6 +160,12 @@ install_packages_in_root (RpmOstreeTreeComposeContext *self, if (!hif_context_setup (hifctx, cancellable, error)) goto out; + /* Forcibly override rpm/librepo SIGINT handlers. We always operate + * in a fully idempotent/atomic mode, and can be killed at any time. + */ + signal (SIGINT, SIG_DFL); + signal (SIGTERM, SIG_DFL); + /* Bind the json \"repos\" member to the hif state, which looks at the * enabled= member of the repos file. By default we forcibly enable * only repos which are specified, ignoring the enabled= flag.