Some functions to manage signal handlers, ignore signals like sig_pipe and code to dettach a process from its terminal and convert it into a daemon.