summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 22:58:33 -0700
committerJohn Denker <jsd@av8n.com>2012-07-13 18:39:07 -0700
commit313acdf3d40ea9d31e8223855ee9252bd7d00177 (patch)
tree79fc49b3a42627858b054284b0176b03efba8a7e
parent867c1d9af13b70548056460339e4af9b29940e53 (diff)
log status when TERM signal received
-rw-r--r--qmail-send.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/qmail-send.c b/qmail-send.c
index 0ea44a1..b01dd41 100644
--- a/qmail-send.c
+++ b/qmail-send.c
@@ -67,7 +67,12 @@ int chanfdout[CHANNELS] = { 1, 3 };
int chanfdin[CHANNELS] = { 2, 4 };
int chanskip[CHANNELS] = { 10, 20 };
-int flagexitasap = 0; void sigterm() { flagexitasap = 1; }
+void del_status();
+int flagexitasap = 0; void sigterm() {
+ log1("Caught TERM signal; will exit ASAP.\n");
+ del_status();
+ flagexitasap = 1;
+}
int flagrunasap = 0; void sigalrm() { flagrunasap = 1; }
int flagreadasap = 0; void sighup() { flagreadasap = 1; }
@@ -156,7 +161,7 @@ char *recip;
if (!stralloc_0(&rwline)) return 0;
return 1;
}
-
+
if (!stralloc_cat(&rwline,&addr)) return 0;
if (!stralloc_0(&rwline)) return 0;
return 2;
@@ -1156,7 +1161,7 @@ unsigned long id;
log3("warning: unable to stat ",fn.s,"; will try again later\n");
goto fail;
}
-
+
fnmake_info(id);
if (stat(fn.s,&st) == -1)
{
@@ -1164,7 +1169,7 @@ unsigned long id;
log3("warning: unable to stat ",fn.s,"; will try again later\n");
goto fail;
}
-
+
/* -todo +info -local -remote ?bounce */
if (!injectbounce(id))
goto fail; /* injectbounce() produced error message */