2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2018-2019 Sadie Powell <sadie@witchery.services>
6 * This file is part of InspIRCd. InspIRCd is free software: you can
7 * redistribute it and/or modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 static volatile sig_atomic_t signaled;
24 class ModuleSSLRehashSignal : public Module
27 static void SignalHandler(int)
33 ~ModuleSSLRehashSignal()
35 signal(SIGUSR1, SIG_IGN);
38 void init() CXX11_OVERRIDE
40 signal(SIGUSR1, SignalHandler);
43 void OnBackgroundTimer(time_t) CXX11_OVERRIDE
48 const std::string feedbackmsg = "Got SIGUSR1, reloading SSL credentials";
49 ServerInstance->SNO->WriteGlobalSno('a', feedbackmsg);
50 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, feedbackmsg);
52 const std::string str = "ssl";
53 FOREACH_MOD(OnModuleRehash, (NULL, str));
57 Version GetVersion() CXX11_OVERRIDE
59 return Version("Reloads SSL credentials on SIGUSR1", VF_VENDOR);
63 MODULE_INIT(ModuleSSLRehashSignal)