diff --git a/manager.py b/manager.py index 6e26502afa..33a4908af6 100644 --- a/manager.py +++ b/manager.py @@ -20,8 +20,8 @@ if __name__ == '__main__': sys.exit() # SystemExit on sigterm - signal.signal(signal.SIGTERM, signal_handler) - os.register_at_fork(after_in_child=lambda: signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGTERM))) + # signal.signal(signal.SIGTERM, signal_handler) + # os.register_at_fork(after_in_child=lambda: signal.signal(signal.SIGTERM, signal.getsignal(signal.SIGTERM))) p = multiprocessing.Process(target=launcher, name='python_process') try: diff --git a/python_process.py b/python_process.py index 600b286774..c425f2d3e4 100644 --- a/python_process.py +++ b/python_process.py @@ -1,12 +1,25 @@ import os import subprocess +import sys +import signal +import time from openpilot.common.basedir import BASEDIR +def signal_handler(sig, frame): + print('python process got signal', sig) + # time.sleep(5) + # sys.exit() + + + def main(): print('pandad!') + # SystemExit on sigterm + # signal.signal(signal.SIGTERM, signal_handler) + while True: os.chdir(os.path.join(BASEDIR)) subprocess.run(["python", "cpp_process.py"], check=True)