]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-event: Add support to eventd for the startup notification FD
authorMartin Schwenke <martin@meltin.net>
Fri, 24 Aug 2018 04:52:29 +0000 (14:52 +1000)
committerStefan Metzmacher <metze@samba.org>
Wed, 5 Sep 2018 11:31:40 +0000 (13:31 +0200)
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)

ctdb/server/ctdb_eventd.c

index feeac074890837e47debf760ccd9260721399b8c..f79ee9990d116d23574652ac0d6715954bad3962 100644 (file)
@@ -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) {