diff options
author | Martin Schwenke <martin@meltin.net> | 2018-08-24 14:52:29 +1000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-09-05 13:31:40 +0200 |
commit | ae515ea3dbef52099535d8621b511c254fc21f86 (patch) | |
tree | 2b0627f49bd97fb974d93fb43d6311a3d2d6002d /ctdb | |
parent | 0e50da4c7ebede054a9f4cf8580e57a7a2aa0c96 (diff) | |
download | samba-ae515ea3dbef52099535d8621b511c254fc21f86.tar.gz |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 11ee92d1bfd73c509d90e7a7386af60a4e1a7fca)
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_eventd.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |