handle SIGTERM for daemonization, as well as SIGINT