bearing / dosenet-raspberrypi

Raspberry Pi specific software for dosimeters.
MIT License
7 stars 21 forks source link

"dosenet.sh stop" should turn off LEDs #14

Closed bplimley closed 8 years ago

bplimley commented 8 years ago

Currently, stopping the dosenet service runs "killall python", and does stop udp_sender and dosimeter.py, but the LEDs are left on.

jccurtis commented 8 years ago

See https://nattster.wordpress.com/2013/06/05/catch-kill-signal-in-python/

import signal import sys

def signal_term_handler(signal, frame): print 'got SIGTERM' sys.exit(0)

signal.signal(signal.SIGTERM, signal_term_handler)