bearing / dosenet-raspberrypi

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

System signal: shutdown manager after next CPM post #50

Closed bplimley closed 8 years ago

bplimley commented 8 years ago

Currently, every night at reboot a data point is lost because the device reboots right before the end of a 5-minute interval. Instead, let's make a way to tell the Manager to stop after this interval.

SIGQUIT looks like a nice sounding signal to use. It can be sent from bash with sudo kill -s SIGQUIT and this can go in dosenet.sh as a new option, finish.

In python, you'll want a second signal handler for the new signal, and some way to communicate this condition into the Manager instance that is running. Try options on sys.exit() or else you may need to define the signal handler inside of if __name__ == '__main__':