def __init__(self):
    self.NUMBER_OF_PROCESSES = cpu_count()

def start(self):
    print('waiting to die')
signal.pause()

def stop(self):
    print('quitting ...')
manager = Manager()
signal.signal(signal.SIGHUP, lambda signum, frame: manager.stop())
manager.start()
Problem with exiting a daemonized process