I am building an application using the Bottle web-framework.
I would like to catch signals USR1 and USR2 to do some work aside from the bottle server. Mainly I want to be able to reload configuration without shutting down the web server because I want some objects to live on.
I tried to handle the signals (USR1 and USR2) on my own using :
signal.signal(signal.SIGUSR1, my_handler)
The problem is that, upon receiving a sigUSR1, the bottle web server crashes with the following trace :
Traceback (most recent call last):
File "giomanager.py", line 46, in <module>
run( giomanager, port=60200 )
File "/usr/lib/python2.7/dist-packages/bottle.py", line 2389, in run
server.run(app)
File "/usr/lib/python2.7/dist-packages/bottle.py", line 2087, in run
srv.serve_forever()
File "/usr/lib/python2.7/SocketServer.py", line 225, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
select.error: (4, 'Interrupted system call')
Do you have an idea why is this happening ? Is it possible to prevent bottle from receiving those signals ?