diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 15:08:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-18 15:08:40 +0200 |
commit | cf750a234613d0af4a4c6c411ab6eea5ba6a219b (patch) | |
tree | 1d5f1b3bddbc09fadda2a63b41fa78a3a42b4c28 /bbot/agent.cxx | |
parent | 2d8dc6c905dbde7da2d324a559d08af77231d062 (diff) |
Add --trust agent option
Diffstat (limited to 'bbot/agent.cxx')
-rw-r--r-- | bbot/agent.cxx | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/bbot/agent.cxx b/bbot/agent.cxx index 8e13720..8847e62 100644 --- a/bbot/agent.cxx +++ b/bbot/agent.cxx @@ -693,17 +693,8 @@ try verb = ops.verbose (); if (ops.systemd_daemon ()) - { systemd_diagnostics (true); // With critical errors. - info << "bbot agent " << BBOT_VERSION_STR << - info << "toolchain name " << tc_name << - info << "toolchain num " << tc_num << - info << "toolchain id " << tc_id << - info << "CPU(s) " << ops.cpu () << - info << "RAM(kB) " << ops.ram (); - } - tracer trace ("main"); uid = getuid (); @@ -771,6 +762,21 @@ try fail << "unable to set signal handler: " << system_error (errno, generic_category ()); // Sanitize. + if (ops.systemd_daemon ()) + { + diag_record dr; + + dr << info << "bbot agent " << BBOT_VERSION_STR << + info << "toolchain name " << tc_name << + info << "toolchain num " << tc_num << + info << "toolchain id " << tc_id << + info << "CPU(s) " << ops.cpu () << + info << "RAM(kB) " << ops.ram (); + + for (const string& u: controllers) + dr << info << "controller url " << u; + } + // The work loop. The steps we go through are: // // 1. Enumerate the available machines, (re-)bootstrapping any if necessary. @@ -906,7 +912,7 @@ try continue; } - const task_manifest& t (*tr.task); + task_manifest& t (*tr.task); if (ops.dump_task ()) { @@ -914,6 +920,12 @@ try return 0; } + // If we have our own repository certificate fingerprints, then use them + // to replace what we have received from the controller. + // + if (!ops.trust ().empty ()) + t.trust = ops.trust (); + const dir_path& d (ds[i]); // The -<toolchain> directory. const bootstrapped_machine_manifest& m (ms[i]); |