Added the forking code of the daemon process.