Make starterd print out its own version on failed applications
We already printed out application versions if they had self-reported a
timing report before crashing; however, it is useful to always have
_some_ version information, so include the starterd's own version in the
log message.
Change-Id: Ia75b8a1b2f54bc659d05b05d131acefa6e2aa8ee
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/starter/starterd.cc b/aos/starter/starterd.cc
index d6caf3f..1ac4514 100644
--- a/aos/starter/starterd.cc
+++ b/aos/starter/starterd.cc
@@ -10,6 +10,8 @@
DEFINE_string(config, "aos_config.json", "File path of aos configuration");
DEFINE_string(user, "",
"Starter runs as though this user ran a SUID binary if set.");
+DEFINE_string(version_string, "",
+ "Version to report for starterd and subprocesses.");
DECLARE_string(shm_base);
DEFINE_bool(purge_shm_base, false,
@@ -58,6 +60,9 @@
const aos::Configuration *config_msg = &config.message();
aos::starter::Starter starter(config_msg);
+ if (!FLAGS_version_string.empty()) {
+ starter.event_loop()->SetVersionString(FLAGS_version_string);
+ }
starter.Run();