X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=door_daemon.py;h=5fb9567272c7b2b34f2ee20ed3d76e0e6940df43;hb=41a6051de9fc6209b9724d59f856beceb0e375d0;hp=76e39515307e80fcd374e457fd3ace974c4efb35;hpb=0a7317d6437ef9aeb9266926e60017150dc181aa;p=svn42.git 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