Do not daemonize (fork) the daemon process

When starting the daemon using an init system, the environment setup
is already being handled by the init system, so there is no need
to daemonize the daemon process create such setup.

By daemonizing the daemon process, it spawns off a new process to
run the daemon and terminates the current process. This causes
a problem with the init system, where it thinks that the daemon
failed to start. We were able to work around it on Chrome OS's
upstart script by adding the forking expectation in the init
scritp ("expect fork"), but there is not such workaround on
Android's init system.

Fix it by removing the daemonize call (daemon()) and remove the
the forking expectation on Chrome OS's init script.

Bug: 24412675
TEST=Manual test on dragonboard
TEST=start/stop apmanager on Chrome OS device

Change-Id: I4dff678946801310982c3af366ab6182f5864a81
2 files changed