dd4ddcd24bde83cb07f75a1aaca8d7ac230fa85a
[packages/erlang.git] / otp-0007-Added-systemd-notify-support-to-EPMD.patch
1 From: Peter Lemenkov <lemenkov@gmail.com>
2 Date: Fri, 6 Jun 2014 15:29:49 +0400
3 Subject: [PATCH] Added systemd notify support to EPMD
4
5 Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
6
7 Conflicts:
8         erts/configure.in
9
10 diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
11 index 3cfa7a7..67e8b49 100644
12 --- a/erts/epmd/src/epmd.c
13 +++ b/erts/epmd/src/epmd.c
14 @@ -589,9 +589,11 @@ void epmd_cleanup_exit(EpmdVars *g, int exitval)
15        for(i=0; g->argv[i] != NULL; ++i)
16           free(g->argv[i]);
17        free(g->argv);
18 -  }      
19 -      
20 -
21 +  }
22 +#ifdef HAVE_SYSTEMD_SD_DAEMON_H
23 +  sd_notifyf(0, "STATUS=Exited.\n"
24 +                "ERRNO=%i", exitval);
25 +#endif // HAVE_SYSTEMD_SD_DAEMON_H
26    exit(exitval);
27  }
28  
29 diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
30 index 48fd7a5..18d898a 100644
31 --- a/erts/epmd/src/epmd_srv.c
32 +++ b/erts/epmd/src/epmd_srv.c
33 @@ -399,8 +399,11 @@ void run(EpmdVars *g)
34        }
35        select_fd_set(g, listensock[i]);
36      }
37 -#ifdef HAVE_SYSTEMD_SD_DAEMON_H 
38 +#ifdef HAVE_SYSTEMD_SD_DAEMON_H
39      }
40 +    sd_notifyf(0, "READY=1\n"
41 +                  "STATUS=Processing port mapping requests...\n"
42 +                  "MAINPID=%lu", (unsigned long) getpid());
43  #endif
44  
45    dbg_tty_printf(g,2,"entering the main select() loop");
This page took 0.12467 seconds and 2 git commands to generate.