Don't use daemon(), set signal handler after fork.