We've seen tracebacks like the one below on our LNT server, indicating
that previously, the code that adds the signal handler could be executed
by a thread that's not the main thread. Fix this by installing the
signal handler at module load time, which is assumed to always run in
the main thread.
File "/lnt/lnt/server/ui/views.py", line 124, in submit_run current_app.old_config, g.db_name, db, path, '<auto>', commit) File "/lnt/lnt/util/ImportData.py", line 120, in import_and_report async_ops.async_fieldchange_calc(db_name, ts, run) File "/lnt/lnt/util/async_ops.py", line 66, in async_fieldchange_calc func_args) File "/lnt/lnt/util/async_ops.py", line 90, in async_run_job launch_workers() File "/lnt/lnt/util/async_ops.py", line 47, in launch_workers signal.signal(signal.SIGTERM, sigHandler)
ValueError: signal only works in main thread