MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / mainEntryClickHouseStatus

Function mainEntryClickHouseStatus

programs/install/Install.cpp:1351–1384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1349
1350int mainEntryClickHouseStatus(int argc, char ** argv);
1351int mainEntryClickHouseStatus(int argc, char ** argv)
1352{
1353 try
1354 {
1355 po::options_description desc;
1356 desc.add_options()
1357 ("help,h", "produce help message")
1358 ("prefix", po::value<std::string>()->default_value("/"), "prefix for all paths")
1359 ("pid-path", po::value<std::string>()->default_value("var/run/clickhouse-server"), "directory for pid file")
1360 ;
1361
1362 po::variables_map options;
1363 po::store(po::parse_command_line(argc, argv, desc), options);
1364
1365 if (options.contains("help"))
1366 {
1367 std::cout << "Usage: " << formatWithSudo("clickhouse status", getuid() != 0) << " [options]\n";
1368 std::cout << desc << "\n";
1369 return 0;
1370 }
1371
1372 fs::path prefix = options["prefix"].as<std::string>();
1373 fs::path pid_file = prefix / options["pid-path"].as<std::string>() / "clickhouse-server.pid";
1374
1375 isRunning(pid_file, /*ignore_file_does_not_exist=*/ false);
1376 }
1377 catch (...)
1378 {
1379 std::cerr << getCurrentExceptionMessage(false) << '\n';
1380 return getCurrentExceptionCode();
1381 }
1382
1383 return 0;
1384}
1385
1386
1387int mainEntryClickHouseRestart(int argc, char ** argv);

Callers

nothing calls this directly

Calls 7

storeFunction · 0.85
formatWithSudoFunction · 0.85
isRunningFunction · 0.85
getCurrentExceptionCodeFunction · 0.85
add_optionsMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected