apmanager: update dnsmasq configuration

By default, dnsmasq process will create another process to run the dnsmasq
task in the background, which results in the background process to run
forever, since the apmanager daemon have no knowledge of that process.
Set the "keep-in-foreground" flag for dnsmasq to prevent it from creating
another process to run in the background.

Also the dnsmasq process runs under "nobody" by default, which might cause
some security concerns. Set the user to "root" for now until we figure out
the privileges required for apmanager daemone and switch over to "apmanager"
user.

BUG=chromium:438836
TEST=unittests
Manual Test:
1. Start an AP service using apmanager, verify only one dnsmasq process is
   running and ran as "root".
2. Terminate the AP service, verify no dnsmasq process is running.

Change-Id: Icf2c77cbeceb35d51a0b098a68d7072692f7cdc9
Reviewed-on: https://chromium-review.googlesource.com/233761
Tested-by: Peter Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
2 files changed