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
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.
Reviewed-by: mukesh agrawal <email@example.com>
Tested-by: Ben Chan <firstname.lastname@example.org>
Commit-Queue: Ben Chan <email@example.com>
2 files changed