controlled_exit
signal(SIGHUP, controlled_exit);
signal(SIGINT, controlled_exit);
signal(SIGTERM, controlled_exit);