2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
5 * Copyright (C) 2018-2020 Sadie Powell <sadie@witchery.services>
7 * This file is part of InspIRCd. InspIRCd is free software: you can
8 * redistribute it and/or modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation, version 2.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 static volatile sig_atomic_t signaled;
25 class ModuleSSLRehashSignal : public Module
28 static void SignalHandler(int)
34 ~ModuleSSLRehashSignal()
36 signal(SIGUSR1, SIG_IGN);
39 void init() CXX11_OVERRIDE
41 signal(SIGUSR1, SignalHandler);
44 void OnBackgroundTimer(time_t) CXX11_OVERRIDE
49 const std::string feedbackmsg = "Got SIGUSR1, reloading TLS (SSL) credentials";
50 ServerInstance->SNO->WriteGlobalSno('a', feedbackmsg);
51 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, feedbackmsg);
53 const std::string str = "tls";
54 FOREACH_MOD(OnModuleRehash, (NULL, str));
58 Version GetVersion() CXX11_OVERRIDE
60 return Version("Allows the SIGUSR1 signal to be sent to the server to reload TLS (SSL) certificates.", VF_VENDOR);
64 MODULE_INIT(ModuleSSLRehashSignal)