From ae515ea3dbef52099535d8621b511c254fc21f86 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 24 Aug 2018 14:52:29 +1000 Subject: [PATCH] ctdb-event: Add support to eventd for the startup notification FD BUG: https://bugzilla.samba.org/show_bug.cgi?id=13592 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 11ee92d1bfd73c509d90e7a7386af60a4e1a7fca) --- ctdb/server/ctdb_eventd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ctdb/server/ctdb_eventd.c b/ctdb/server/ctdb_eventd.c index feeac074890..f79ee9990d1 100644 --- a/ctdb/server/ctdb_eventd.c +++ b/ctdb/server/ctdb_eventd.c @@ -952,8 +952,10 @@ static struct { const char *pidfile; const char *socket; int pid; + int startup_fd; } options = { .debug_level = "ERR", + .startup_fd = -1, }; struct poptOption cmdline_options[] = { @@ -972,6 +974,8 @@ struct poptOption cmdline_options[] = { "eventd pid file", "FILE" }, { "socket", 's', POPT_ARG_STRING, &options.socket, 0, "eventd socket path", "FILE" }, + { "startup-fd", 'S', POPT_ARG_INT, &options.startup_fd, 0, + "file descriptor to notify of successful start", "FD" }, POPT_TABLEEND }; @@ -1068,6 +1072,10 @@ int main(int argc, const char **argv) goto fail; } + if (options.startup_fd != -1) { + sock_daemon_set_startup_fd(sockd, options.startup_fd); + } + ret = sock_daemon_run(ev, sockd, options.pidfile, false, false, options.pid); if (ret == EINTR) { -- 2.47.2