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

Function mainEntryClickHouseStatus

programs/install/Install.cpp:823–854  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

821
822
823int mainEntryClickHouseStatus(int argc, char ** argv)
824{
825 po::options_description desc;
826 desc.add_options()
827 ("help,h", "produce help message")
828 ("pid-path", po::value<std::string>()->default_value("/var/run/clickhouse-server"), "directory for pid file")
829 ;
830
831 po::variables_map options;
832 po::store(po::parse_command_line(argc, argv, desc), options);
833
834 if (options.count("help"))
835 {
836 std::cout << "Usage: "
837 << (getuid() == 0 ? "" : "sudo ")
838 << argv[0]
839 << " status\n";
840 return 1;
841 }
842
843 try
844 {
845 fs::path pid_file = fs::path(options["pid-path"].as<std::string>()) / "clickhouse-server.pid";
846 isRunning(pid_file);
847 return 0;
848 }
849 catch (...)
850 {
851 std::cerr << getCurrentExceptionMessage(false) << '\n';
852 return getCurrentExceptionCode();
853 }
854}
855
856
857int mainEntryClickHouseRestart(int argc, char ** argv)

Callers

nothing calls this directly

Calls 6

storeFunction · 0.85
isRunningFunction · 0.85
getCurrentExceptionCodeFunction · 0.85
getuidFunction · 0.50
countMethod · 0.45

Tested by

no test coverage detected