aboutsummaryrefslogtreecommitdiffstats
path: root/erts/epmd/src/epmd.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-03-27 10:23:28 +0100
committerLukas Larsson <[email protected]>2014-03-27 10:23:28 +0100
commitbe5ad8be918b803d4224e8d6b17a508d2559b8a1 (patch)
treeb2ff548843c6abc9b2ada2cc0fdc4ef5f0ce4525 /erts/epmd/src/epmd.c
parent70d60cb4d825464149ca48fdeeb350ac4689cc00 (diff)
parentb7c95eabf6017ddb352fb8ce2b3749af108ebf29 (diff)
downloadotp-be5ad8be918b803d4224e8d6b17a508d2559b8a1.tar.gz
otp-be5ad8be918b803d4224e8d6b17a508d2559b8a1.tar.bz2
otp-be5ad8be918b803d4224e8d6b17a508d2559b8a1.zip
Merge branch 'matwey/systemd/OTP-11829'
* matwey/systemd/OTP-11829: Add systemd socket activation for epmd. Conflicts: erts/epmd/src/epmd_int.h Extra ticket: OTP-11828
Diffstat (limited to 'erts/epmd/src/epmd.c')
-rw-r--r--erts/epmd/src/epmd.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/erts/epmd/src/epmd.c b/erts/epmd/src/epmd.c
index 1678d537d1..3cfa7a782f 100644
--- a/erts/epmd/src/epmd.c
+++ b/erts/epmd/src/epmd.c
@@ -175,6 +175,9 @@ int main(int argc, char** argv)
g->nodes.reg = g->nodes.unreg = g->nodes.unreg_tail = NULL;
g->nodes.unreg_count = 0;
g->active_conn = 0;
+#ifdef HAVE_SYSTEMD_SD_DAEMON_H
+ g->is_systemd = 0;
+#endif
for (i = 0; i < MAX_LISTEN_SOCKETS; i++)
g->listenfd[i] = -1;
@@ -248,8 +251,12 @@ int main(int argc, char** argv)
else
usage(g);
epmd_cleanup_exit(g,0);
- }
- else
+#ifdef HAVE_SYSTEMD_SD_DAEMON_H
+ } else if (strcmp(argv[0], "-systemd") == 0) {
+ g->is_systemd = 1;
+ argv++; argc--;
+#endif
+ } else
usage(g);
}
dbg_printf(g,1,"epmd running - daemon = %d",g->is_daemon);
@@ -454,6 +461,11 @@ static void usage(EpmdVars *g)
fprintf(stderr, " Forcibly unregisters a name with epmd\n");
fprintf(stderr, " (only allowed if -relaxed_command_check was given when \n");
fprintf(stderr, " epmd was started).\n");
+#ifdef HAVE_SYSTEMD_SD_DAEMON_H
+ fprintf(stderr, " -systemd\n");
+ fprintf(stderr, " Wait for socket from systemd. The option makes sense\n");
+ fprintf(stderr, " when started from .socket unit.\n");
+#endif
epmd_cleanup_exit(g,1);
}