Add support for capturing stdout/err in Application
This also makes it so that the Application object can poll instead of
just relying on SIGCHLD to watch for application stops, to make it a bit
cleaner for simple use-cases.
Change-Id: I8af71e1dd89e0cfa1b189ba1e5264df0df9b9560
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/starterd_lib.cc b/aos/starter/starterd_lib.cc
index 03b40c8..008c46f 100644
--- a/aos/starter/starterd_lib.cc
+++ b/aos/starter/starterd_lib.cc
@@ -169,9 +169,11 @@
applications_.try_emplace(application->name()->str(), application,
&event_loop_, [this]() { MaybeSendStatus(); });
if (success) {
- if (application->has_args()) {
- iter->second.set_args(*application->args());
- }
+ // We should be catching and handling SIGCHLD correctly in the starter, so
+ // don't leave in the crutch for polling for the child process status (this
+ // is less about efficiency, and more about making sure bit rot doesn't
+ // result in the signal handling breaking).
+ iter->second.DisableChildDeathPolling();
return &(iter->second);
}
return nullptr;