summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-17 12:15:32 +0000
committerribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-17 12:15:32 +0000
commita32595594ddd1ea9ed4eaffc4947995602b13860 (patch)
tree35588455237765f80ca00fce3013a4cc03a4549c
parent632a8f669c302a6920445c76325eee6ada08613b (diff)
BUILD : 1.7.1 (57) BUGS : NOTES : Added SIGUSR2 to rehash configuration and save databases
git-svn-id: svn://svn.anope.org/anope/trunk@57 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@38 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--init.c3
-rw-r--r--main.c16
-rw-r--r--version.log6
4 files changed, 24 insertions, 2 deletions
diff --git a/Changes b/Changes
index 755ae7c04..a213f3c5e 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Anope Version SVN
--------------------
Provided by Anope Dev. <dev@anope.org>
+2004/04/17 Added SIGUSR2 signal to Rehash Config and Save DBs
2004/04/16 Fixed broken password saves to MySQL (Bug #11)
Anope Version 1.7.1
diff --git a/init.c b/init.c
index 46287fbd8..f3e52188d 100644
--- a/init.c
+++ b/init.c
@@ -605,7 +605,7 @@ int init(int ac, char **av)
for (i = 1; i <= 31; i++) {
#endif
#if defined(USE_THREADS) && defined(LINUX20)
- if (i != SIGUSR1 && i != SIGUSR2)
+ if (i != SIGUSR1)
#endif
signal(i, SIG_IGN);
}
@@ -630,6 +630,7 @@ int init(int ac, char **av)
}
signal(SIGQUIT, sighandler);
signal(SIGHUP, sighandler);
+ signal(SIGUSR2, sighandler);
#ifdef SIGIOT
signal(SIGIOT, sighandler);
diff --git a/main.c b/main.c
index 516add1da..cb9c3a009 100644
--- a/main.c
+++ b/main.c
@@ -249,6 +249,7 @@ void sighandler(int signum)
if (started) {
if (signum == SIGHUP) { /* SIGHUP = save databases and restart */
signal(SIGHUP, SIG_IGN);
+ signal(SIGUSR2, SIG_IGN);
alog("Received SIGHUP, restarting.");
expire_all();
@@ -264,6 +265,21 @@ void sighandler(int signum)
quitmsg =
"Restart attempt failed--SERVICES_BIN not defined (rerun configure)";
#endif
+
+ } else if (signum == SIGUSR2) {
+
+ alog("Received SIGUSR2: Saving Databases & Rehash Configuration");
+
+ expire_all();
+ save_databases();
+
+ if (!read_config(1)) {
+ sprintf(quitmsg,
+ "Error Reading Configuration File (Received SIGUSR2)");
+ quitting = 1;
+ }
+ return;
+
} else if (signum == SIGTERM) {
signal(SIGTERM, SIG_IGN);
signal(SIGHUP, SIG_IGN);
diff --git a/version.log b/version.log
index c362f1ae1..3411f45b9 100644
--- a/version.log
+++ b/version.log
@@ -8,11 +8,15 @@
VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="1"
-VERSION_BUILD="56"
+VERSION_BUILD="57"
VERSION_EXTRA=""
# $Log$
#
+# BUILD : 1.7.1 (57)
+# BUGS :
+# NOTES : Added SIGUSR2 to rehash configuration and save databases
+#
# BUILD : 1.7.1 (56)
# NOTES : Fourth time is a charm? Fixinf MySQL password saves.
#