Q: What is the purpose of SIGTERM and SIGINT in the Signal Handler?
A: The SIGTERM and SIGINT handlers are to catch those standard signals (like Ctrl+C) and allow the application to exit cleaning instead of “crashing”.
http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html