X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fquassel.cpp;h=28fb2b08ab6301f60bfd0d72f3a1240d0fe8d6e6;hb=eebabe9514044150c2dbff477a8752c1649054bc;hp=6671bc4757af375cc814add2f7d44597f3bdcce7;hpb=620cd1aa35e05099b3f84400dd33afc207c98244;p=quassel.git diff --git a/src/common/quassel.cpp b/src/common/quassel.cpp index 6671bc47..28fb2b08 100644 --- a/src/common/quassel.cpp +++ b/src/common/quassel.cpp @@ -72,6 +72,11 @@ Quassel::Quassel() // We catch SIGTERM and SIGINT (caused by Ctrl+C) to graceful shutdown Quassel. signal(SIGTERM, handleSignal); signal(SIGINT, handleSignal); +#ifndef Q_OS_WIN + // SIGHUP is used to reload configuration (i.e. SSL certificates) + // Windows does not support SIGHUP + signal(SIGHUP, handleSignal); +#endif } @@ -323,6 +328,20 @@ void Quassel::handleSignal(int sig) else QCoreApplication::quit(); break; +#ifndef Q_OS_WIN +// Windows does not support SIGHUP + case SIGHUP: + // Most applications use this as the 'configuration reload' command, e.g. nginx uses it for + // graceful reloading of processes. + if (_instance) { + // If the instance exists, reload the configuration + quInfo() << "Caught signal" << SIGHUP <<"- reloading configuration"; + if (_instance->reloadConfig()) { + quInfo() << "Successfully reloaded configuration"; + } + } + break; +#endif case SIGABRT: case SIGSEGV: #ifndef Q_OS_WIN