[PATCH 1/7] Move the signal handler into the StageBase class so it can handle unbind() cleanup
From 106c588e852927d244df2a9b66d188c60252e31d Mon Sep 17 00:00:00 2001
From: Brian Dolbec <[hidden email]>
Date: Mon, 7 Sep 2015 23:15:25 -0700
Subject: [PATCH 1/7] Move the signal handler into the StageBase class so it
can handle unbind() cleanup
To: [hidden email]
Not quite complete, still errors on some unmounting
bin/catalyst | 19 -------------------
catalyst/base/stagebase.py | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/bin/catalyst b/bin/catalyst
index 72a4cb4d..a64cfce8 100755
@@ -12,25 +12,6 @@ from __future__ import print_function
-# This block ensures that ^C interrupts are handled quietly.
- import signal
- def exithandler(_signum, _frame):
- signal.signal(signal.SIGINT, signal.SIG_IGN)
- signal.signal(signal.SIGTERM, signal.SIG_IGN)
- signal.signal(signal.SIGINT, exithandler)
- signal.signal(signal.SIGTERM, exithandler)
- signal.signal(signal.SIGPIPE, signal.SIG_DFL)
from catalyst.main import main
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index b857a64b..eed14589 100644
@@ -2,6 +2,7 @@
from snakeoil import fileutils
@@ -206,6 +207,17 @@ class StageBase(TargetBase, ClearBase, GenBase):
if "portage_confdir" in self.settings:
file_locate(self.settings, ["portage_confdir"], expand = 0)
Re: [PATCH 1/7] Move the signal handler into the StageBase class so it can handle unbind() cleanup
On 10 Mar 2017 11:22, Brian Dolbec wrote:
> Subject: [PATCH 1/7] Move the signal handler into the StageBase class so it
> can handle unbind() cleanup
> Not quite complete, still errors on some unmounting
i don't think moving signal handling into a random module makes sense.
the main loop should be responsible for this business. i.e. where the
code is now (or in catalyst._main).
if the only thing you want to handle is clean up of mounts, then we
should be looking at mount namespaces instead. unlike other namespaces,
support for mount namespaces has been around forever and can't be turned
off in the kernel.
the releng repo deals with this by running everything through unshare.
snakeoil already includes namespace support. i'll send a patch.