shill: process management using libchromeos's process library
This provides APIs for process creation and asynchronous process
termination.
Exit callback will not be invoked when the caller initiates the process
termination. In this case, the caller is not interested in the
exit callback anymore and the callback might've been cleanup by the caller
by the time the process terminates.
When terminating a process, ProcessManager will attempt to send a
SIGTERM signal to the process first, and then attempt SIGKILL signal
if it doesn't terminate within certain timeout. If the process
failed to terminate with both attempts, an error message will be logged,
and we will give up on terminating that process.
BUG=chromium:516841
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill
Change-Id: Iae201c1f8d0c86a96af71befb2c35b195b900dbb
Reviewed-on: https://chromium-review.googlesource.com/290652
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
diff --git a/shill.gyp b/shill.gyp
index 6f37e9c..ef88bb1 100644
--- a/shill.gyp
+++ b/shill.gyp
@@ -558,6 +558,7 @@
'ppp_device_factory.cc',
'pppoe/pppoe_service.cc',
'process_killer.cc',
+ 'process_manager.cc',
'profile.cc',
'profile_dbus_adaptor.cc',
'property_store.cc',
@@ -807,6 +808,7 @@
'mock_ppp_device.cc',
'mock_ppp_device_factory.cc',
'mock_process_killer.cc',
+ 'mock_process_manager.cc',
'mock_profile.cc',
'mock_property_store.cc',
'mock_resolver.cc',
@@ -834,6 +836,7 @@
'ppp_device_unittest.cc',
'pppoe/pppoe_service_unittest.cc',
'process_killer_unittest.cc',
+ 'process_manager_unittest.cc',
'profile_unittest.cc',
'property_accessor_unittest.cc',
'property_observer_unittest.cc',