From 41a6051de9fc6209b9724d59f856beceb0e375d0 Mon Sep 17 00:00:00 2001 From: realraum Date: Thu, 30 Apr 2009 03:41:47 +0000 Subject: [PATCH] signals don't work, basta --- door_daemon.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/door_daemon.py b/door_daemon.py index 76e3951..5fb9567 100755 --- a/door_daemon.py +++ b/door_daemon.py @@ -50,7 +50,7 @@ class ArduinoUSBThread ( threading.Thread ): self.cv_updatestatus = threading.Condition(); #lock ist automatically created withing condition self.file_dev_ttyusb=file_dev_ttyusb #self.fh = open(self.file_dev_ttyusb,"w+") - self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK ),"r+") + self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK),"r+") self.statusdisplay = StatusDisplay() threading.Thread.__init__(self) @@ -201,8 +201,6 @@ class ControlFIFOThread ( threading.Thread ): fifofile = "/tmp/door_cmd.socket" -logging.info("Door Daemon started") - arduino = ArduinoUSBThread("/dev/ttyUSB0") arduino.start() ctrlfifo = ControlFIFOThread(fifofile,arduino) @@ -216,6 +214,10 @@ def exit_handler(signum, frame): arduino.stop() sys.exit(0) -signal.signal(signal.SIGTERM, exit_handler) +#signal.signal(signal.SIGTERM, exit_handler) signal.signal(signal.SIGINT, exit_handler) signal.signal(signal.SIGQUIT, exit_handler) + +logging.info("Door Daemon started") +arduino.join() +ctrlfifo.join() \ No newline at end of file -- 1.7.10.4