summaryrefslogtreecommitdiff
path: root/ctdb/event
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-08-24 14:52:29 +1000
committerAmitay Isaacs <amitay@samba.org>2018-08-30 04:48:56 +0200
commit11ee92d1bfd73c509d90e7a7386af60a4e1a7fca (patch)
treef9c5a17945f4dabf9a95e51471db0638127b523a /ctdb/event
parentdc6040c121c65d5551c686f3f1be2891795f48aa (diff)
downloadsamba-11ee92d1bfd73c509d90e7a7386af60a4e1a7fca.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>
Diffstat (limited to 'ctdb/event')
-rw-r--r--ctdb/event/event_daemon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ctdb/event/event_daemon.c b/ctdb/event/event_daemon.c
index 63c4dad2866..c1c6852cca5 100644
--- a/ctdb/event/event_daemon.c
+++ b/ctdb/event/event_daemon.c
@@ -218,14 +218,18 @@ static bool event_client_recv(struct tevent_req *req, int *perr)
static struct {
int pid;
+ int startup_fd;
} options = {
.pid = -1,
+ .startup_fd = -1,
};
struct poptOption cmdline_options[] = {
POPT_AUTOHELP
{ "pid", 'P', POPT_ARG_INT, &options.pid, 0,
"pid to wait for", "PID" },
+ { "startup-fd", 'S', POPT_ARG_INT, &options.startup_fd, 0,
+ "file descriptor to notify of successful start", "FD" },
POPT_TABLEEND
};
@@ -338,6 +342,10 @@ int main(int argc, const char **argv)
goto fail;
}
+ if (options.startup_fd != -1) {
+ sock_daemon_set_startup_fd(e_state->sockd, options.startup_fd);
+ }
+
ret = sock_daemon_run(e_state->ev,
e_state->sockd,
e_state->pidfile,