Use daemon() rather than fork()/exit() to self-background, to avoid tty signals.