0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 04:08:54 +02:00

construct: Add back the SIGUSR1 handler to rehash running conf from !conf room.

This commit is contained in:
Jason Volk 2018-05-25 21:08:44 -07:00
parent 37f8868afc
commit 0311f4d44e

View file

@ -115,6 +115,7 @@ try
sigs.add(SIGINT); sigs.add(SIGINT);
sigs.add(SIGQUIT); sigs.add(SIGQUIT);
sigs.add(SIGTERM); sigs.add(SIGTERM);
sigs.add(SIGUSR1);
sigs.async_wait(sigfd_handler); sigs.async_wait(sigfd_handler);
// Because we registered signal handlers with the io_context, ios->run() // Because we registered signal handlers with the io_context, ios->run()
@ -234,6 +235,7 @@ enable_coredumps()
static void handle_quit(); static void handle_quit();
static void handle_interruption(); static void handle_interruption();
static void handle_hangup(); static void handle_hangup();
static void handle_usr1();
static void handle(const int &signum); static void handle(const int &signum);
void void
@ -279,6 +281,7 @@ handle(const int &signum)
case SIGHUP: return handle_hangup(); case SIGHUP: return handle_hangup();
case SIGQUIT: return handle_quit(); case SIGQUIT: return handle_quit();
case SIGTERM: return handle_quit(); case SIGTERM: return handle_quit();
case SIGUSR1: return handle_usr1();
} }
} }
@ -327,3 +330,22 @@ catch(const std::exception &e)
"SIGINT handler: %s", e.what() "SIGINT handler: %s", e.what()
}; };
} }
void
handle_usr1()
try
{
static ircd::m::import<void ()> rehash_conf
{
"s_conf", "rehash_conf"
};
rehash_conf();
}
catch(const std::exception &e)
{
ircd::log::error
{
"SIGUSR1 handler: %s", e.what()
};
}