ph10 2005/06/21 15:14:56 BST
Modified files:
exim-doc/doc-misc WishList
exim-doc/doc-txt ChangeLog NewStuff OptionLists.txt
exim-src/src daemon.c globals.c globals.h readconf.c
exim-test-orig/AutoTest/confs 002
exim-test-orig/AutoTest/stdout 001 002
Log:
Implement daemon_startup_{retries,sleep} to control startup retrying.
Revision Changes Path
1.40 +0 -6 exim/exim-doc/doc-misc/WishList
1.166 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.51 +6 -0 exim/exim-doc/doc-txt/NewStuff
1.9 +2 -0 exim/exim-doc/doc-txt/OptionLists.txt
1.11 +6 -4 exim/exim-src/src/daemon.c
1.30 +2 -0 exim/exim-src/src/globals.c
1.22 +2 -0 exim/exim-src/src/globals.h
1.10 +2 -0 exim/exim-src/src/readconf.c
1.10 +2 -0 exim/exim-test-orig/AutoTest/confs/002
1.13 +2 -0 exim/exim-test-orig/AutoTest/stdout/001
1.11 +2 -0 exim/exim-test-orig/AutoTest/stdout/002
Index: WishList
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-misc/WishList,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- WishList 16 Jun 2005 15:48:58 -0000 1.39
+++ WishList 21 Jun 2005 14:14:55 -0000 1.40
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-misc/WishList,v 1.39 2005/06/16 15:48:58 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-misc/WishList,v 1.40 2005/06/21 14:14:55 ph10 Exp $
EXIM 4 WISH LIST
----------------
@@ -1879,12 +1879,6 @@
Bogofilter at smtp time. Bogofilter requires a filename, not a directory. The
file would contain the complete email. I suppose there may be other scanning
solutions with a similar requirement."
-------------------------------------------------------------------------------
-
-(320) 03-Mar-05 T Options to control daemon retry binding
-
-Currently the daemon tries 10 times at 30-second intervals to listen on an IP
-address. The wish is for options to control these numbers.
------------------------------------------------------------------------------
(321) 07-Mar-05 S Run an ACL on a sync error
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- ChangeLog 20 Jun 2005 13:58:22 -0000 1.165
+++ ChangeLog 21 Jun 2005 14:14:55 -0000 1.166
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.165 2005/06/20 13:58:22 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.166 2005/06/21 14:14:55 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -171,6 +171,8 @@
the control was given.
These problems did NOT occur unless DomainKeys support was compiled.
+
+PH/23 Added daemon_startup_retries and daemon_startup_sleep.
Exim version 4.51
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- NewStuff 16 Jun 2005 20:03:43 -0000 1.50
+++ NewStuff 21 Jun 2005 14:14:55 -0000 1.51
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.50 2005/06/16 20:03:43 tom Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.51 2005/06/21 14:14:55 ph10 Exp $
New Features in Exim
--------------------
@@ -342,6 +342,12 @@
sender='${quote_mysql:$sender_address}'} \
{$value}fail}}}
+PH/04 There are two new options that control the retrying done by the daemon
+ at startup when it cannot immediately bind a socket (typically because
+ the socket is already in use). The default values reproduce what were
+ built-in constants previously: daemon_startup_retries defines the number
+ of retries after the first failure (default 9); daemon_startup_sleep
+ defines the length of time to wait between retries (default 30s).
Version 4.51
Index: OptionLists.txt
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/OptionLists.txt,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- OptionLists.txt 3 May 2005 14:20:00 -0000 1.8
+++ OptionLists.txt 21 Jun 2005 14:14:55 -0000 1.9
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/OptionLists.txt,v 1.8 2005/05/03 14:20:00 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/OptionLists.txt,v 1.9 2005/06/21 14:14:55 ph10 Exp $
LISTS OF EXIM OPTIONS
---------------------
@@ -140,6 +140,8 @@
current_directory string unset transports 4.00
unset queryprogram 4.00
daemon_smtp_ports string unset main 1.75 pluralised in 4.21
+daemon_startup_retries int 9 main 4.52
+daemon_startup_sleep time 30s main 4.52
data string unset redirect 4.00
data_timeout time 5m smtp
debug_print string* unset authenticators 4.00
Index: daemon.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/daemon.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- daemon.c 15 Mar 2005 14:09:12 -0000 1.10
+++ daemon.c 21 Jun 2005 14:14:55 -0000 1.11
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/daemon.c,v 1.10 2005/03/15 14:09:12 ph10 Exp $ */
+/* $Cambridge: exim/exim-src/src/daemon.c,v 1.11 2005/06/21 14:14:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1249,7 +1249,6 @@
{
BOOL wildcard;
ip_address_item *ipa2;
- int retries = 9;
int af;
if (Ustrchr(ipa->address, ':') != NULL)
@@ -1327,13 +1326,16 @@
msg = US strerror(errno);
addr = wildcard? ((af == AF_INET6)? US"(any IPv6)" : US"(any IPv4)") :
ipa->address;
- if (retries-- <= 0)
+ if (daemon_startup_retries <= 0)
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"socket bind() to port %d for address %s failed: %s: "
"daemon abandoned", ipa->port, addr, msg);
log_write(0, LOG_MAIN, "socket bind() to port %d for address %s "
- "failed: %s: waiting before trying again", ipa->port, addr, msg);
- sleep(30);
+ "failed: %s: waiting %s before trying again (%d more %s)",
+ ipa->port, addr, msg, readconf_printtime(daemon_startup_sleep),
+ daemon_startup_retries, (daemon_startup_retries > 1)? "tries" : "try");
+ daemon_startup_retries--;
+ sleep(daemon_startup_sleep);
}
DEBUG(D_any)
Index: globals.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/globals.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- globals.c 16 Jun 2005 20:01:29 -0000 1.29
+++ globals.c 21 Jun 2005 14:14:55 -0000 1.30
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/globals.c,v 1.29 2005/06/16 20:01:29 tom Exp $ */
+/* $Cambridge: exim/exim-src/src/globals.c,v 1.30 2005/06/21 14:14:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -392,6 +392,8 @@
BOOL daemon_listen = FALSE;
uschar *daemon_smtp_port = US"smtp";
+int daemon_startup_retries = 9;
+int daemon_startup_sleep = 30;
BOOL debug_daemon = FALSE;
int debug_fd = -1;
FILE *debug_file = NULL;
Index: globals.h
===================================================================
RCS file: /home/cvs/exim/exim-src/src/globals.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- globals.h 16 Jun 2005 20:01:29 -0000 1.21
+++ globals.h 21 Jun 2005 14:14:55 -0000 1.22
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/globals.h,v 1.21 2005/06/16 20:01:29 tom Exp $ */
+/* $Cambridge: exim/exim-src/src/globals.h,v 1.22 2005/06/21 14:14:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -218,6 +218,8 @@
extern BOOL daemon_listen; /* True if listening required */
extern uschar *daemon_smtp_port; /* Can be a list of ports */
+extern int daemon_startup_retries; /* Number of times to retry */
+extern int daemon_startup_sleep; /* Sleep between retries */
extern BOOL debug_daemon; /* Debug the daemon process only */
extern int debug_fd; /* The fd for debug_file */
extern FILE *debug_file; /* Where to write debugging info */
Index: readconf.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/readconf.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- readconf.c 24 May 2005 08:15:02 -0000 1.9
+++ readconf.c 21 Jun 2005 14:14:55 -0000 1.10
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/readconf.c,v 1.9 2005/05/24 08:15:02 tom Exp $ */
+/* $Cambridge: exim/exim-src/src/readconf.c,v 1.10 2005/06/21 14:14:55 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -186,6 +186,8 @@
{ "check_spool_space", opt_Kint, &check_spool_space },
{ "daemon_smtp_port", opt_stringptr|opt_hidden, &daemon_smtp_port },
{ "daemon_smtp_ports", opt_stringptr, &daemon_smtp_port },
+ { "daemon_startup_retries", opt_int, &daemon_startup_retries },
+ { "daemon_startup_sleep", opt_time, &daemon_startup_sleep },
{ "delay_warning", opt_timelist, &delay_warning },
{ "delay_warning_condition", opt_stringptr, &delay_warning_condition },
{ "deliver_drop_privilege", opt_bool, &deliver_drop_privilege },
Index: 002
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/confs/002,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- 002 10 May 2005 10:19:11 -0000 1.9
+++ 002 21 Jun 2005 14:14:55 -0000 1.10
@@ -54,6 +54,8 @@
check_spool_space = 0
daemon_smtp_port =
daemon_smtp_ports =
+daemon_startup_retries = 3
+daemon_startup_sleep = 8s
delay_warning = 1d
delay_warning_condition = ${if match{$h_precedence:}{(?i)bulk|list}{no}{yes}}
deliver_drop_privilege
Index: 001
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/001,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- 001 20 Jun 2005 13:58:23 -0000 1.12
+++ 001 21 Jun 2005 14:14:56 -0000 1.13
@@ -39,6 +39,8 @@
check_spool_inodes = 0
check_spool_space = 0
daemon_smtp_ports = smtp
+daemon_startup_retries = 9
+daemon_startup_sleep = 30s
delay_warning = 1d
delay_warning_condition = ${if match{$h_precedence:}{(?i)bulk|list|junk}{no}{yes}}
no_deliver_drop_privilege
Index: 002
===================================================================
RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/002,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- 002 20 Jun 2005 13:58:23 -0000 1.10
+++ 002 21 Jun 2005 14:14:56 -0000 1.11
@@ -39,6 +39,8 @@
check_spool_inodes = 0
check_spool_space = 0
daemon_smtp_ports =
+daemon_startup_retries = 3
+daemon_startup_sleep = 8s
delay_warning = 1d
delay_warning_condition = ${if match{$h_precedence:}{(?i)bulk|list}{no}{yes}}
deliver_drop_privilege