2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2018 Peter Powell <petpow@saberuk.com>
5 * Copyright (C) 2016 Attila Molnar <attilamolnar@hush.com>
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);
41 signal(SIGUSR1, SignalHandler);
44 void OnBackgroundTimer(time_t)
49 const std::string feedbackmsg = "Got SIGUSR1, reloading SSL credentials";
50 ServerInstance->SNO->WriteGlobalSno('a', feedbackmsg);
51 ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, feedbackmsg);
53 const std::string str = "ssl";
54 FOREACH_MOD(OnModuleRehash, (NULL, str));
60 return Version("Reloads SSL credentials on SIGUSR1", VF_VENDOR);
64 MODULE_INIT(ModuleSSLRehashSignal)