]> code.delx.au - bg-scripts/blob - lib/SigHandler.py
9b494d14ab8e25bbabf0554a2a0d03257c39fdd9
[bg-scripts] / lib / SigHandler.py
1 #! python
2
3 from signal import signal, SIGHUP, SIGTERM
4
5 class HUPInterrupt(Exception):
6 pass
7 class TERMInterrupt(Exception):
8 pass
9
10 def HUPHandler(signal, stackFrame):
11 raise HUPInterrupt
12
13 def TERMHandler(signal, stackFrame):
14 raise TERMInterrupt
15
16 # Install the handlers
17 signal(SIGHUP, HUPHandler)
18 signal(SIGTERM, TERMHandler)