From: Martin Schwenke Date: Fri, 24 Aug 2018 04:52:29 +0000 (+1000) Subject: ctdb-event: Add support to eventd for the startup notification FD X-Git-Tag: samba-4.8.6~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae515ea3dbef52099535d8621b511c254fc21f86;p=thirdparty%2Fsamba.git 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) --- 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) {