shill: provide ability to configure children to terminate with parent

If shill crashes and restarts, it will re-initialize its state about
its peer daemons (e.g. wpasupplicant, ModemManager). Child processes,
however, do not always provide a way to query their current state.

For dhcpcd, we deal with this problem by having the child process
(dhcpcd) monitor D-Bus events to determine when shill exits. When
that occurs, dhcpcd terminates itself. In this way, a newly spawned
shill process doesn't have to worry about an old dhcpcd conflicting
with one fired off by the (new) shill process.

Since pppd doesn't have integrated D-Bus support, doing the same
for pppd could be hairy. Instead, use prctl() to ask the kernel
to deliver SIGTERM to pppd when shill exits.

BUG=chromium:261710
TEST=manual

Manual test
-----------
- plug in ppp dongle
- wait for network to connect
- killall -9 shill
- egrep 'pppd.+Terminating on signal 15' /var/log/net.log

Change-Id: I7513ccfa8de0b154d233d8a4d6f1bc701af32974
Reviewed-on: https://gerrit.chromium.org/gerrit/66031
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/mock_external_task.h b/mock_external_task.h
index 6469c83..62c7455 100644
--- a/mock_external_task.h
+++ b/mock_external_task.h
@@ -19,10 +19,11 @@
                    const base::Callback<void(pid_t, int)> &death_callback);
   virtual ~MockExternalTask();
 
-  MOCK_METHOD4(Start,
+  MOCK_METHOD5(Start,
                bool(const base::FilePath &file,
                     const std::vector<std::string> &arguments,
                     const std::map<std::string, std::string> &environment,
+                    bool terminate_with_parent,
                     Error *error));
   MOCK_METHOD0(Stop, void());
   MOCK_METHOD0(OnDelete, void());