// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "wrapper.h" #include #include #include #include #include LOG_SETUP("vespa-otelcol-start"); static void run(const char *configId) { vespalib::SigCatch catcher; Wrapper handler(configId); handler.start(configId); while (! catcher.receivedStopSignal()) { handler.check(); usleep(125000); // Avoid busy looping; } handler.stop(); }; int main(int argc, char** argv) { vespa::Defaults::bootstrap(argv[0]); int c = -1; const char *cfid = nullptr; while ((c = getopt(argc, argv, "c:")) != -1) { switch (c) { case 'c': cfid = optarg; break; default: cfid = nullptr; break; } } if (cfid == nullptr) { LOG(error, "Usage: %s -c ", argv[0]); return EXIT_FAILURE; } run(cfid); return 0; }