MCPcopy Create free account
hub / github.com/apache/mesos / main

Function main

src/slave/main.cpp:245–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244
245int main(int argc, char** argv)
246{
247 // The order of initialization is as follows:
248 // * Windows socket stack.
249 // * Validate flags.
250 // * Logging
251 // * Log build information.
252 // * Libprocess
253 // * Version process
254 // * Firewall rules: should be initialized before initializing HTTP endpoints.
255 // * Modules: Load module libraries and manifests before they
256 // can be instantiated.
257 // * Anonymous modules: Later components such as Allocators, and master
258 // contender/detector might depend upon anonymous modules.
259 // * Hooks.
260 // * Systemd support (if it exists).
261 // * Fetcher, SecretResolver, and Containerizer.
262 // * Master detector.
263 // * Authorizer.
264 // * Garbage collector.
265 // * Task status update manager.
266 // * Resource estimator.
267 // * QoS controller.
268 // * `Agent` process.
269 //
270 // TODO(avinash): Add more comments discussing the rationale behind for this
271 // particular component ordering.
272
273 GOOGLE_PROTOBUF_VERIFY_VERSION;
274
275 slave::Flags flags;
276
277 Try<flags::Warnings> load = flags.load("MESOS_", argc, argv);
278
279 if (flags.help) {
280 cout << flags.usage() << endl;
281 return EXIT_SUCCESS;
282 }
283
284 if (flags.version) {
285 cout << "mesos" << " " << MESOS_VERSION << endl;
286 return EXIT_SUCCESS;
287 }
288
289 if (load.isError()) {
290 cerr << load.error() << "\n\n"
291 << "See `mesos-agent --help` for a list of supported flags." << endl;
292 return EXIT_FAILURE;
293 }
294
295 logging::initialize(argv[0], true, flags); // Catch signals.
296
297 // Log any flag warnings (after logging is initialized).
298 foreach (const flags::Warning& warning, load->warnings) {
299 LOG(WARNING) << warning.message;
300 }
301
302 // Check that agent's version has the expected format (SemVer).

Callers

nothing calls this directly

Calls 15

trimFunction · 0.85
assignCgroupsFunction · 0.85
generateFunction · 0.85
loadFunction · 0.85
permissionsFunction · 0.85
NoneClass · 0.85
setCallbacksFunction · 0.85
startsWithFunction · 0.85
listenFdsWithNamesFunction · 0.85
createDomainSocketFunction · 0.85
finalizeFunction · 0.85

Tested by

no test coverage detected