summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/app.py')
-rw-r--r--src/leap/bitmask/app.py34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py
index fa244470..e80b9dd1 100644
--- a/src/leap/bitmask/app.py
+++ b/src/leap/bitmask/app.py
@@ -41,10 +41,8 @@
# (thanks to: http://www.glassgiant.com/ascii/)
import multiprocessing
import os
-import signal
import sys
-from functools import partial
from leap.bitmask.backend.utils import generate_certificates
@@ -111,27 +109,6 @@ def do_mail_plumbing(opts):
# XXX catch when import is used w/o acct
-def sigterm_handler(logger, gui_process, backend_process, signum, frame):
- """
- Signal handler that quits the running app cleanly.
-
- :param logger: the configured logger object.
- :type logger: logging.Logger
- :param gui_process: the GUI process
- :type gui_process: multiprocessing.Process
- :param backend_process: the backend process
- :type backend_process: multiprocessing.Process
- :param signum: number of the signal received (e.g. SIGINT -> 2)
- :type signum: int
- :param frame: current stack frame
- :type frame: frame or None
- """
- logger.debug("SIGTERM catched, terminating processes.")
- gui_process.terminate()
- # Don't terminate the backend, the frontend takes care of that.
- # backend_process.terminate()
-
-
def start_app():
"""
Starts the main event loop and launches the main window.
@@ -203,18 +180,13 @@ def start_app():
flags_dict = flags_to_dict()
- app = lambda: run_frontend(options, flags_dict)
- gui_process = multiprocessing.Process(target=app, name='Frontend')
- gui_process.start()
-
backend = lambda: run_backend(opts.danger, flags_dict)
backend_process = multiprocessing.Process(target=backend, name='Backend')
+ backend_process.daemon = True
backend_process.start()
- handle_sigterm = partial(sigterm_handler, logger,
- gui_process, backend_process)
- signal.signal(signal.SIGTERM, handle_sigterm)
- signal.signal(signal.SIGINT, handle_sigterm)
+ run_frontend(options, flags_dict)
+
if __name__ == "__main__":