[exim-cvs] Support use-but-not-create of notifier socket

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] Support use-but-not-create of notifier socket
Gitweb: https://git.exim.org/exim.git/commitdiff/f108ec74c278b14363dc9ad1274596f284d21868
Commit:     f108ec74c278b14363dc9ad1274596f284d21868
Parent:     f0860486ef8da605996e3330157e331c2452419b
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Jan 27 10:31:11 2023 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Jan 27 10:31:11 2023 +0000


    Support use-but-not-create of notifier socket
---
 doc/doc-docbook/spec.xfpt | 10 ++++++++--
 src/src/daemon.c          |  7 ++++++-
 src/src/exim.c            |  2 +-
 src/src/globals.c         |  1 +
 src/src/globals.h         |  1 +
 5 files changed, 17 insertions(+), 4 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 4a6b9bfd0..cc5923069 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -4397,15 +4397,21 @@ It is only relevant when the &%-bd%& (start listening daemon) option is also
given.
Normally the daemon creates this socket, unless a &%-oX%& and &*no*& &%-oP%&
option is also present.
-If this option is given then the socket will not be created. This could be
-required if the system is running multiple daemons.
+.new
+If this option is given then the socket will not be created. This is required
+if the system is running multiple daemons, in which case it should
+be used on all.
+The features supported by the socket will not be available in such cases.

The socket is currently used for
.ilist
fast ramp-up of queue runner processes
.next
+caching compiled regexes
+.next
obtaining a current queue size
.endlist
+.wen

.cmdopt -pd
.cindex "Perl" "starting the interpreter"
diff --git a/src/src/daemon.c b/src/src/daemon.c
index 05d94b188..c3ab735d0 100644
--- a/src/src/daemon.c
+++ b/src/src/daemon.c
@@ -1169,7 +1169,7 @@ const uschar * where;
struct sockaddr_un sa_un = {.sun_family = AF_UNIX};
ssize_t len;

-if (!notifier_socket || !*notifier_socket)
+if (!f.notifier_socket_en)
   {
   DEBUG(D_any) debug_printf("-oY used so not creating notifier socket\n");
   return;
@@ -1180,6 +1180,11 @@ if (override_local_interfaces && !override_pid_file_path)
     debug_printf("-oX used without -oP so not creating notifier socket\n");
   return;
   }
+if (!notifier_socket || !*notifier_socket)
+  {
+  DEBUG(D_any) debug_printf("no name for notifier socket\n");
+  return;
+  }


DEBUG(D_any) debug_printf("creating notifier socket\n");

diff --git a/src/src/exim.c b/src/src/exim.c
index dc082f392..9072ffd54 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -3450,7 +3450,7 @@ on the second character (the one after '-'), to save some effort. */

       case 'Y':
     if (*argrest) badarg = TRUE;
-    else notifier_socket = NULL;
+    else f.notifier_socket_en = FALSE;
     break;


       /* Unknown -o argument */
diff --git a/src/src/globals.c b/src/src/globals.c
index efe34902a..7af345465 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -280,6 +280,7 @@ struct global_flags f =
     .no_mbox_unspool        = FALSE,
 #endif
     .no_multiline_responses = FALSE,
+    .notifier_socket_en    = TRUE,


     .parse_allow_group      = FALSE,
     .parse_found_group      = FALSE,
diff --git a/src/src/globals.h b/src/src/globals.h
index 5aae73fba..f2e147670 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -246,6 +246,7 @@ extern struct global_flags {
  BOOL   no_mbox_unspool            :1; /* don't unlink files in /scan directory */
 #endif
  BOOL   no_multiline_responses        :1; /* For broken clients */
+ BOOL   notifier_socket_en        :1; /* Permit create of notifier socket */


  BOOL   parse_allow_group        :1; /* Allow group syntax */
  BOOL   parse_found_group        :1; /* In the middle of a group */