Skip to content

Commit

Permalink
stop led-server on SIGTERM #5
Browse files Browse the repository at this point in the history
  • Loading branch information
gotzl committed Feb 19, 2024
1 parent c094d26 commit be66d45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/fanatec_led_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def _do_run(self):
from ams2 import AMS2Client

import argparse
import signal

parser = argparse.ArgumentParser(
description="Advanced functions for fanatec wheels with ACC"
Expand Down Expand Up @@ -240,6 +241,10 @@ def _do_run(self):
try:
ev = threading.Event()

def handle_sigterm(sig, frame):
ev.set()
signal.signal(signal.SIGTERM, handle_sigterm)

threads = []
for typ in [F1_23Client, AcClient, AccClient, RF2Client, WrcClient, AMS2Client]:
threads.append(typ(ev, args.dbus, args.device, args.display))
Expand Down

0 comments on commit be66d45

Please sign in to comment.