aboutsummaryrefslogtreecommitdiffstats
path: root/erts/epmd/src/epmd_srv.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-11-25 11:53:24 +0100
committerLukas Larsson <[email protected]>2014-11-25 11:53:24 +0100
commitc181536aabe2140d3547ba34c6b7ef2ae0109c65 (patch)
treee8e7d7844481b19fb6726146c166eee9c9edf30e /erts/epmd/src/epmd_srv.c
parent872fa86ddebbc84b07dc5426d25f7fb300731f52 (diff)
parent5db2345baa3bb9c835f91aafac3dde6e595debc7 (diff)
downloadotp-c181536aabe2140d3547ba34c6b7ef2ae0109c65.tar.gz
otp-c181536aabe2140d3547ba34c6b7ef2ae0109c65.tar.bz2
otp-c181536aabe2140d3547ba34c6b7ef2ae0109c65.zip
Merge branch 'lem/epmd_sd_notify/OTP-12321' into maint
* lem/epmd_sd_notify/OTP-12321: epmd: Unify systemd autoconf macros usage epmd: Added systemd notify support to EPMD
Diffstat (limited to 'erts/epmd/src/epmd_srv.c')
-rw-r--r--erts/epmd/src/epmd_srv.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 48fd7a5f9c..26e42adb19 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -244,7 +244,7 @@ void run(EpmdVars *g)
}
else
{
-#endif
+#endif /* HAVE_SYSTEMD_DAEMON */
dbg_printf(g,2,"try to initiate listening port %d", g->port);
@@ -312,7 +312,7 @@ void run(EpmdVars *g)
}
#ifdef HAVE_SYSTEMD_DAEMON
}
-#endif
+#endif /* HAVE_SYSTEMD_DAEMON */
#if !defined(__WIN32__) && !defined(__OSE__)
/* We ignore the SIGPIPE signal that is raised when we call write
@@ -330,13 +330,13 @@ void run(EpmdVars *g)
FD_ZERO(&g->orig_read_mask);
g->select_fd_top = 0;
-#ifdef HAVE_SYSTEMD_SD_DAEMON_H
+#ifdef HAVE_SYSTEMD_DAEMON
if (g->is_systemd)
for (i = 0; i < num_sockets; i++)
select_fd_set(g, listensock[i]);
else
{
-#endif
+#endif /* HAVE_SYSTEMD_DAEMON */
for (i = 0; i < num_sockets; i++)
{
if ((listensock[i] = socket(FAMILY,SOCK_STREAM,0)) < 0)
@@ -399,9 +399,12 @@ void run(EpmdVars *g)
}
select_fd_set(g, listensock[i]);
}
-#ifdef HAVE_SYSTEMD_SD_DAEMON_H
+#ifdef HAVE_SYSTEMD_DAEMON
}
-#endif
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Processing port mapping requests...\n"
+ "MAINPID=%lu", (unsigned long) getpid());
+#endif /* HAVE_SYSTEMD_DAEMON */
dbg_tty_printf(g,2,"entering the main select() loop");