RAC-oi
2024-03-05 f0fa340535e7fa86271556e6eed4be947881912f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff -Nuraw otp_src_26.2.2_O/erts/epmd/src/epmd.c otp_src_26.2.2/erts/epmd/src/epmd.c
--- otp_src_26.2.2_O/erts/epmd/src/epmd.c    2024-02-07 15:00:00.000000000 +0100
+++ otp_src_26.2.2/erts/epmd/src/epmd.c    2024-02-18 03:45:07.000000000 +0100
@@ -124,6 +124,7 @@
     g->debug          = 0;
 
     g->silent         = 0; 
+    g->logging        = 1;
     g->is_daemon      = 0;
     g->brutal_kill    = check_relaxed();
     g->packet_timeout = CLOSE_TIMEOUT; /* Default timeout */
@@ -215,6 +216,9 @@
             g->is_systemd = 1;
             argv++; argc--;
 #endif /* HAVE_SYSTEMD_DAEMON */
+    } else if (strcmp(argv[0], "-disable_syslog") == 0) {
+        g->logging = 0;
+        argv++; argc--;
     } else
         usage(g);
     }
@@ -253,6 +257,7 @@
     if (( child_pid = fork()) < 0)
       {
 #ifdef HAVE_SYSLOG_H
+    if (g->logging)
     syslog(LOG_ERR,"erlang mapper daemon can't fork %m");
 #endif
     epmd_cleanup_exit(g,1);
@@ -279,6 +284,7 @@
     if ((child_pid = fork()) < 0)
       {
 #ifdef HAVE_SYSLOG_H
+    if (g->logging)
     syslog(LOG_ERR,"erlang mapper daemon can't fork 2'nd time %m");
 #endif
     epmd_cleanup_exit(g,1);
@@ -448,7 +454,7 @@
   if (g->is_daemon)
     {
 #ifdef HAVE_SYSLOG_H
-      if (onsyslog)
+    if (onsyslog && g->logging == 1)
     {
       erts_vsnprintf(buf, DEBUG_BUFFER_SIZE, format, args);
       syslog(LOG_ERR,"epmd: %s",buf);
diff -Nuraw otp_src_26.2.2_O/erts/epmd/src/epmd_int.h otp_src_26.2.2/erts/epmd/src/epmd_int.h
--- otp_src_26.2.2_O/erts/epmd/src/epmd_int.h    2024-02-07 15:00:00.000000000 +0100
+++ otp_src_26.2.2/erts/epmd/src/epmd_int.h    2024-02-18 03:44:24.000000000 +0100
@@ -317,6 +317,7 @@
   int port;
   int debug;
   int silent; 
+  int logging;
   int is_daemon;
   int brutal_kill;
   unsigned packet_timeout;