diff options
| author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-01-23 07:32:56 +0000 |
|---|---|---|
| committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-01-23 07:32:56 +0000 |
| commit | 01f32cf2881f781fa934623361a146e55fcca8b6 (patch) | |
| tree | c48dfedffd26ef58826ed918c9b4c1d029eb6252 /src/main.c | |
| parent | ba7b29bba7ea10b4813d42efbc79c3a0bb01c461 (diff) | |
BUILD : 1.7.7 (555) BUGS : N/A NOTES : TS6 support, Ratbox support, lots of little bug fixes, updated documentation
git-svn-id: svn://svn.anope.org/anope/trunk@555 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@408 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index a44cda93c..e3eb8d05e 100644 --- a/src/main.c +++ b/src/main.c @@ -253,6 +253,8 @@ void do_restart_services(void) static void services_shutdown(void) { + User *u, *next; + if (!quitmsg) quitmsg = "Terminating, reason unknown"; alog("%s", quitmsg); @@ -263,6 +265,12 @@ static void services_shutdown(void) if (ircd->chanmodes) { Anope_Free(ircd->chanmodes); } + u = firstuser(); + while (u) { + next = nextuser(); + delete_user(u); + u = next; + } } disconn(servsock); } @@ -318,7 +326,18 @@ void sighandler(int signum) quitmsg = "Shutting down on SIGTERM"; services_shutdown(); exit(0); - } else if (signum == SIGINT || signum == SIGQUIT) { + + } else if (signum == SIGINT) { + if (nofork) { + signal(SIGINT, SIG_IGN); + alog("Received SIGINT, exiting."); + expire_all(); + save_databases(); + quitmsg = "Shutting down on SIGINT"; + services_shutdown(); + exit(0); + } + } else if (signum == SIGQUIT) { /* nothing -- terminate below */ } else if (!waiting) { alog("PANIC! buffer = %s", inbuf); |
