Prevent multiple instances of cros-disks from running.
DBus::Connection::request_name() does not indicate whether it
successfully acquires the requested DBus name or not. This CL changes
cros-disks to use newly introduced DBus::Connection::acquire_name()
(CL:195002) to ensure that cros-disks 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 cros-disks` and then `start cros-disks` works
- `restart cros-disks` works
- `/opt/google/cros-disks/disks --foreground` fails to acquire the
DBus name when another instance of cros-disks is already running.
Change-Id: Ifa29fe403e7af78bfbb9e2cfe9e8cfe48b2c54b4
Reviewed-on: https://chromium-review.googlesource.com/195456
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2 files changed