| | |
| | | signal(SIGUSR1, Server::handleSignal); |
| | | if (!config.loadFromFile("/etc/fserver/config.json")) |
| | | { |
| | | std::cerr << "Failed to load config.json" << std::endl; |
| | | LOG(ERROR) << "Failed to load /etc/fserver/config.json"; |
| | | } |
| | | loadPlugins(); |
| | | for (int i = 0; i < 4; ++i) |
| | |
| | | { |
| | | if (config.loadFromFile("/etc/fserver/config.json")) |
| | | { |
| | | // std::cout << "Configuration reloaded." << std::endl; |
| | | LOG(INFO) << "Configuration reloaded /etc/fserver/config.json"; |
| | | |
| | | // Stop and clear existing plugins |
| | |
| | | { |
| | | if (signal == SIGUSR1) |
| | | { |
| | | std::cout << "Received signal to reload configuration." << std::endl; |
| | | LOG(INFO) << "Reloading config file by SIGUSR1"; |
| | | Server::getInstance().reloadConfigFlag.store(true); |
| | | } |
| | | } |