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

Function mainEntryClickHouseStop

programs/install/Install.cpp:788–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

786
787
788int mainEntryClickHouseStop(int argc, char ** argv)
789{
790 po::options_description desc;
791 desc.add_options()
792 ("help,h", "produce help message")
793 ("pid-path", po::value<std::string>()->default_value("/var/run/clickhouse-server"), "directory for pid file")
794 ("force", po::bool_switch(), "Stop with KILL signal instead of TERM")
795 ;
796
797 po::variables_map options;
798 po::store(po::parse_command_line(argc, argv, desc), options);
799
800 if (options.count("help"))
801 {
802 std::cout << "Usage: "
803 << (getuid() == 0 ? "" : "sudo ")
804 << argv[0]
805 << " stop\n";
806 return 1;
807 }
808
809 try
810 {
811 fs::path pid_file = fs::path(options["pid-path"].as<std::string>()) / "clickhouse-server.pid";
812
813 return stop(pid_file, options["force"].as<bool>());
814 }
815 catch (...)
816 {
817 std::cerr << getCurrentExceptionMessage(false) << '\n';
818 return getCurrentExceptionCode();
819 }
820}
821
822
823int mainEntryClickHouseStatus(int argc, char ** argv)

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected