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. .gitignore
  2. OWNERS
  3. README
  4. debugd.gyp
  5. doc/
  6. share/
  7. src/