debugd: Prevent multiple instances of debugd from running.

DBus::Connection::request_name() does not indicate whether it
successfully acquires the requested DBus name or not. This CL changes
debugd to use newly introduced DBus::Connection::acquire_name()
(CL:195002) to ensure that debugd can successfully acquire its DBus
name.

BUG=chromium:364585
TEST=Tested the following:
1. `FEATURES=test emerge-$BOARD platform2`
2. Manually run the following commands in a root shell on the DUT:
   - `stop debugd` and then `start debugd` works
   - `restart debugd` works
   - `debugd` fails to acquire the DBus name when another instance of
     debugd is already running.

Change-Id: Ibe27a0ab2c49047b86411a4e62639c0f45a5b5cf
Reviewed-on: https://chromium-review.googlesource.com/195484
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
1 file changed
tree: 596d73b7d1528546274cb74fc947f0a6d611ddb9
  1. doc/
  2. share/
  3. src/
  4. .gitignore
  5. debugd.gyp
  6. OWNERS
  7. README