The branch, master has been updated
       via  a92fd11 ctdb-daemon: Remove ctdb_fork_with_logging()
       via  dd98b9d ctdb-tests: Set CTDB_EVENT_HELPER when running with local 
daemons
       via  97575e1 ctdb-daemon: Remove unused code to run eventscripts
       via  18c1f43 ctdb-daemon: Replace ctdb_fork_with_logging with 
ctdb_vfork_with_logging (part 2)
       via  d86662a ctdb-daemon: Replace ctdb_fork_with_logging with 
ctdb_vfork_with_logging (part 1)
       via  69324b6 ctdb-daemon: Add helper process to execute event scripts
       via  2879404 ctdb-daemon: Add ctdb_vfork_with_logging()
       via  7aa20cc ctdb-daemon: No need to call event scripts with 
CTDB_CALLED_BY_USER
       via  bafa467 ctdb-daemon: Deprecate RELOAD and STATUS events
       via  b8c6bcc ctdb-common: mkdir_p should not try to create .
      from  276c161 vfs/glusterfs: in case atime is not passed, set it to the 
current atime

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a92fd11ad1ccc904a999a254d249bbdc74f08f84
Author: Amitay Isaacs <[email protected]>
Date:   Wed Dec 18 14:09:52 2013 +1100

    ctdb-daemon: Remove ctdb_fork_with_logging()
    
    This function has been replaced with ctdb_vfork_with_logging().
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>
    
    Autobuild-User(master): Martin Schwenke <[email protected]>
    Autobuild-Date(master): Thu Jan 16 04:05:35 CET 2014 on sn-devel-104

commit dd98b9df6651054dabefdf439735042a78cfea2e
Author: Amitay Isaacs <[email protected]>
Date:   Mon Jan 13 15:16:46 2014 +1100

    ctdb-tests: Set CTDB_EVENT_HELPER when running with local daemons
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit 97575e1ba0b7fecef2b26f2da1c0d8cb769a37a8
Author: Amitay Isaacs <[email protected]>
Date:   Tue Dec 17 19:22:20 2013 +1100

    ctdb-daemon: Remove unused code to run eventscripts
    
    Eventscripts are now executed using a helper.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit 18c1f432102f1a5093927be9276d001180539e50
Author: Amitay Isaacs <[email protected]>
Date:   Wed Dec 18 14:07:57 2013 +1100

    ctdb-daemon: Replace ctdb_fork_with_logging with ctdb_vfork_with_logging 
(part 2)
    
    Use ctdb_event_helper to run debug-hung-script.sh.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit d86662a925a072eb0374ad7743f4cf95c447bebb
Author: Amitay Isaacs <[email protected]>
Date:   Tue Dec 17 19:19:51 2013 +1100

    ctdb-daemon: Replace ctdb_fork_with_logging with ctdb_vfork_with_logging 
(part 1)
    
    Use ctdb_event_helper to run eventscripts.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit 69324b61f0669022c7204ee08a4c7104865d4e9b
Author: Amitay Isaacs <[email protected]>
Date:   Mon Dec 16 15:40:01 2013 +1100

    ctdb-daemon: Add helper process to execute event scripts
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit 2879404388ed04af199a7e4451605b4435e8cc23
Author: Amitay Isaacs <[email protected]>
Date:   Mon Dec 16 15:39:29 2013 +1100

    ctdb-daemon: Add ctdb_vfork_with_logging()
    
    This will be used to spawn lightweight helper processes to run
    eventscripts.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit 7aa20ccb5c747707fca349e9e0847cd0fca8c839
Author: Amitay Isaacs <[email protected]>
Date:   Mon Dec 16 15:57:42 2013 +1100

    ctdb-daemon: No need to call event scripts with CTDB_CALLED_BY_USER
    
    This was added to support external monitoring using CTDB event scripts.
    However, it was never used.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit bafa467021b7b2f17c61904b9f70f695a4395921
Author: Amitay Isaacs <[email protected]>
Date:   Mon Dec 23 11:46:48 2013 +1100

    ctdb-daemon: Deprecate RELOAD and STATUS events
    
    These events have never been used.
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

commit b8c6bcc365ce08ddc0ebf51c002d53c08f144981
Author: Amitay Isaacs <[email protected]>
Date:   Tue Dec 17 19:48:29 2013 +1100

    ctdb-common: mkdir_p should not try to create .
    
    Signed-off-by: Amitay Isaacs <[email protected]>
    Reviewed-by: Martin Schwenke <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/Makefile.in                             |    7 +-
 ctdb/common/system_common.c                  |    4 +
 ctdb/include/ctdb_private.h                  |   17 +-
 ctdb/include/ctdb_protocol.h                 |    4 +-
 ctdb/packaging/RPM/ctdb.spec.in              |    1 +
 ctdb/server/ctdb_daemon.c                    |    1 -
 ctdb/server/ctdb_event_helper.c              |  136 +++++++++++++
 ctdb/server/ctdb_logging.c                   |   62 ++++--
 ctdb/server/ctdb_monitor.c                   |    4 +-
 ctdb/server/ctdb_recover.c                   |    3 +-
 ctdb/server/ctdb_takeover.c                  |    6 +-
 ctdb/server/eventscript.c                    |  266 ++++++++++----------------
 ctdb/tests/simple/scripts/local_daemons.bash |    1 +
 13 files changed, 308 insertions(+), 204 deletions(-)
 create mode 100644 ctdb/server/ctdb_event_helper.c


Changeset truncated at 500 lines:

diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in
index 92bd56f..94904bd 100755
--- a/ctdb/Makefile.in
+++ b/ctdb/Makefile.in
@@ -120,7 +120,7 @@ TEST_BINS=tests/bin/ctdb_bench tests/bin/ctdb_fetch 
tests/bin/ctdb_fetch_one \
        @INFINIBAND_BINS@
 
 BINS = bin/ctdb @CTDB_SCSI_IO@ bin/smnotify bin/ping_pong bin/ltdbtool \
-       bin/ctdb_lock_helper @CTDB_PMDA@
+       bin/ctdb_lock_helper bin/ctdb_event_helper @CTDB_PMDA@
 
 SBINS = bin/ctdbd
 
@@ -178,6 +178,10 @@ bin/ctdb_lock_helper: server/ctdb_lock_helper.o 
lib/util/util_file.o $(CTDB_EXTE
        @echo Linking $@
        $(WRAPPER) $(CC) $(CFLAGS) -o $@ server/ctdb_lock_helper.o 
lib/util/util_file.o $(CTDB_EXTERNAL_OBJ) $(TDB_LIBS) $(LIB_FLAGS)
 
+bin/ctdb_event_helper: server/ctdb_event_helper.o $(SOCKET_WRAPPER_OBJ)
+       @echo Linking $@
+       $(WRAPPER) $(CC) $(CFLAGS) -o $@ server/ctdb_event_helper.o  
$(SOCKET_WRAPPER_OBJ) $(LIB_FLAGS)
+
 bin/smnotify: utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o 
utils/smnotify/smnotify.o $(POPT_OBJ)
        @echo Linking $@
        $(WRAPPER) $(CC) $(CFLAGS) -o $@ utils/smnotify/smnotify.o 
utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o $(POPT_OBJ) $(LIB_FLAGS)
@@ -332,6 +336,7 @@ install: all manpages $(PMDA_INSTALL)
        $(INSTALLCMD) -m 755 bin/ping_pong $(DESTDIR)$(bindir)
        $(INSTALLCMD) -m 755 bin/ltdbtool $(DESTDIR)$(bindir)
        $(INSTALLCMD) -m 755 bin/ctdb_lock_helper $(DESTDIR)$(bindir)
+       $(INSTALLCMD) -m 755 bin/ctdb_event_helper $(DESTDIR)$(bindir)
        ${INSTALLCMD} -m 644 include/ctdb.h $(DESTDIR)$(includedir)
        ${INSTALLCMD} -m 644 include/ctdb_client.h $(DESTDIR)$(includedir)
        ${INSTALLCMD} -m 644 include/ctdb_protocol.h $(DESTDIR)$(includedir)
diff --git a/ctdb/common/system_common.c b/ctdb/common/system_common.c
index 7563ff3..cc22f69 100644
--- a/ctdb/common/system_common.c
+++ b/ctdb/common/system_common.c
@@ -169,6 +169,10 @@ int mkdir_p(const char *dir, int mode)
                return 0;
        }
 
+       if (strcmp(dir, ".") == 0) {
+               return 0;
+       }
+
        t = talloc_strdup(NULL, dir);
        if (t == NULL) {
                return ENOMEM;
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 71c9f13..5c18d87 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -1245,9 +1245,8 @@ int ctdb_event_script_callback(struct ctdb_context *ctdb,
                               TALLOC_CTX *mem_ctx,
                               void (*callback)(struct ctdb_context *, int, 
void *),
                               void *private_data,
-                              bool from_user,
                               enum ctdb_eventscript_call call,
-                              const char *fmt, ...) PRINTF_ATTRIBUTE(7,8);
+                              const char *fmt, ...) PRINTF_ATTRIBUTE(6,7);
 void ctdb_release_all_ips(struct ctdb_context *ctdb);
 
 void set_nonblocking(int fd);
@@ -1457,11 +1456,15 @@ int32_t ctdb_control_get_log(struct ctdb_context *ctdb, 
TDB_DATA addr);
 int32_t ctdb_control_clear_log(struct ctdb_context *ctdb);
 void ctdb_log_ringbuffer_free(void);
 
-struct ctdb_log_state *ctdb_fork_with_logging(TALLOC_CTX *mem_ctx,
-                                             struct ctdb_context *ctdb,
-                                             const char *log_prefix,
-                                             void (*logfn)(const char *, 
uint16_t, void *),
-                                             void *logfn_private, pid_t *pid);
+struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX *mem_ctx,
+                                              struct ctdb_context *ctdb,
+                                              const char *log_prefix,
+                                              const char *helper,
+                                              int helper_argc,
+                                              const char **helper_argv,
+                                              void (*logfn)(const char *, 
uint16_t, void *),
+                                              void *logfn_private, pid_t *pid);
+
 
 int32_t ctdb_control_process_exists(struct ctdb_context *ctdb, pid_t pid);
 struct ctdb_client *ctdb_find_client_by_pid(struct ctdb_context *ctdb, pid_t 
pid);
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 15c87be..fa03a4b 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -240,9 +240,9 @@ enum ctdb_eventscript_call {
        CTDB_EVENT_RELEASE_IP,          /* IP released: interface, IP address, 
netmask bits. */
        CTDB_EVENT_STOPPED,             /* Deprecated, do not use. */
        CTDB_EVENT_MONITOR,             /* Please check if service is healthy: 
no args. */
-       CTDB_EVENT_STATUS,              /* Report service status: no args. */
+       CTDB_EVENT_STATUS,              /* Deprecated, do not use. */
        CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
-       CTDB_EVENT_RELOAD,              /* magic */
+       CTDB_EVENT_RELOAD,              /* Deprecated, do not use */
        CTDB_EVENT_UPDATE_IP,           /* IP updating: old interface, new 
interface, IP address, netmask bits. */
        CTDB_EVENT_IPREALLOCATED,       /* when a takeover_run() completes */
        CTDB_EVENT_MAX
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
index e3a3486..b2520c3 100644
--- a/ctdb/packaging/RPM/ctdb.spec.in
+++ b/ctdb/packaging/RPM/ctdb.spec.in
@@ -192,6 +192,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/ctdbd_wrapper
 %{_bindir}/ctdb
 %{_bindir}/ctdb_lock_helper
+%{_bindir}/ctdb_event_helper
 %{_bindir}/smnotify
 %{_bindir}/ping_pong
 %{_bindir}/ltdbtool
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index 50b2de3..aa0cedb 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -1312,7 +1312,6 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool 
do_fork, bool use_syslog)
                                         ctdb,
                                         ctdb_setup_event_callback,
                                         ctdb,
-                                        false,
                                         CTDB_EVENT_SETUP,
                                         "%s",
                                         "");
diff --git a/ctdb/server/ctdb_event_helper.c b/ctdb/server/ctdb_event_helper.c
new file mode 100644
index 0000000..4c62e41
--- /dev/null
+++ b/ctdb/server/ctdb_event_helper.c
@@ -0,0 +1,136 @@
+/*
+   ctdb event script helper
+
+   Copyright (C) Amitay Isaacs  2013
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "system/filesys.h"
+
+static char *progname = NULL;
+
+
+/* CTDB sends SIGTERM, when process must die */
+static void sigterm(int sig)
+{
+       pid_t pid;
+
+       /* all the child processes are running in the same process group */
+       pid = getpgrp();
+       if (pid == -1) {
+               kill(-getpid(), SIGKILL);
+       } else {
+               kill(-pid, SIGKILL);
+       }
+       _exit(0);
+}
+
+static void set_close_on_exec(int fd)
+{
+       int v;
+
+       v = fcntl(fd, F_GETFD, 0);
+       if (v == -1) {
+               return;
+       }
+       fcntl(fd, F_SETFD, v | FD_CLOEXEC);
+}
+
+static int check_executable(const char *path)
+{
+       struct stat st;
+
+       if (stat(path, &st) != 0) {
+               fprintf(stderr, "Failed to access '%s' - %s\n",
+                       path, strerror(errno));
+               return errno;
+       }
+
+       if (!(st.st_mode & S_IXUSR)) {
+               return ENOEXEC;
+       }
+
+       return 0;
+}
+
+static void usage(void)
+{
+       fprintf(stderr, "\n");
+       fprintf(stderr, "Usage: %s <log-fd> <output-fd> <script_path> <event> 
[<args>]\n",
+               progname);
+}
+
+int main(int argc, char *argv[])
+{
+       int log_fd, write_fd;
+       pid_t pid;
+       int status, output;
+
+       progname = argv[0];
+
+       if (argc < 5) {
+               usage();
+               exit(1);
+       }
+
+       log_fd = atoi(argv[1]);
+       write_fd = atoi(argv[2]);
+
+       set_close_on_exec(write_fd);
+
+       close(STDOUT_FILENO);
+       close(STDERR_FILENO);
+       dup2(log_fd, STDOUT_FILENO);
+       dup2(log_fd, STDERR_FILENO);
+       close(log_fd);
+
+       if (setpgid(0, 0) != 0) {
+               fprintf(stderr, "Failed to create process group for event 
script - %s\n",
+                       strerror(errno));
+               exit(1);
+       }
+
+       signal(SIGTERM, sigterm);
+
+       pid = fork();
+       if (pid < 0) {
+               fprintf(stderr, "Failed to fork - %s\n", strerror(errno));
+               exit(errno);
+       }
+
+       if (pid == 0) {
+               int save_errno;
+
+               execv(argv[3], &argv[3]);
+               if (errno == EACCES) {
+                       save_errno = check_executable(argv[3]);
+               } else {
+                       save_errno = errno;
+                       fprintf(stderr, "Error executing '%s' - %s\n",
+                               argv[3], strerror(errno));
+               }
+               _exit(save_errno);
+       }
+
+       waitpid(pid, &status, 0);
+       if (WIFEXITED(status)) {
+               output = -WEXITSTATUS(status);
+               write(write_fd, &output, sizeof(output));
+               exit(output);
+       }
+
+       exit(1);
+}
diff --git a/ctdb/server/ctdb_logging.c b/ctdb/server/ctdb_logging.c
index 17c5c35..d334191 100644
--- a/ctdb/server/ctdb_logging.c
+++ b/ctdb/server/ctdb_logging.c
@@ -469,56 +469,73 @@ static int log_context_destructor(struct ctdb_log_state 
*log)
 }
 
 /*
-   fork(), redirecting child output to logging and specified callback.
-*/
-struct ctdb_log_state *ctdb_fork_with_logging(TALLOC_CTX *mem_ctx,
-                                             struct ctdb_context *ctdb,
-                                             const char *log_prefix,
-                                             void (*logfn)(const char *, 
uint16_t, void *),
-                                             void *logfn_private, pid_t *pid)
+ * vfork + exec, redirecting child output to logging and specified callback.
+ */
+struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX *mem_ctx,
+                                              struct ctdb_context *ctdb,
+                                              const char *log_prefix,
+                                              const char *helper,
+                                              int helper_argc,
+                                              const char **helper_argv,
+                                              void (*logfn)(const char *, 
uint16_t, void *),
+                                              void *logfn_private, pid_t *pid)
 {
        int p[2];
        struct ctdb_log_state *log;
        struct tevent_fd *fde;
+       char **argv;
+       int i;
 
        log = talloc_zero(mem_ctx, struct ctdb_log_state);
        CTDB_NO_MEMORY_NULL(ctdb, log);
+
        log->ctdb = ctdb;
        log->prefix = log_prefix;
        log->logfn = logfn;
-       log->logfn_private = (void *)logfn_private;
+       log->logfn_private = logfn_private;
 
        if (pipe(p) != 0) {
-               DEBUG(DEBUG_ERR,(__location__ " Failed to setup for child 
logging pipe\n"));
+               DEBUG(DEBUG_ERR, (__location__ " Failed to setup pipe for child 
logging\n"));
+               goto free_log;
+       }
+
+       argv = talloc_array(mem_ctx, char *, helper_argc + 2);
+       if (argv == NULL) {
+               DEBUG(DEBUG_ERR, (__location__ "Failed to allocate memory for 
helper\n"));
+               goto free_log;
+       }
+       argv[0] = discard_const(helper);
+       argv[1] = talloc_asprintf(argv, "%d", p[1]);
+       if (argv[1] == NULL) {
+               DEBUG(DEBUG_ERR, (__location__ "Failed to allocate memory for 
helper\n"));
+               talloc_free(argv);
                goto free_log;
        }
 
-       *pid = ctdb_fork(ctdb);
+       for (i=0; i<helper_argc; i++) {
+               argv[i+2] = discard_const(helper_argv[i]);
+       }
 
-       /* Child? */
+       *pid = vfork();
        if (*pid == 0) {
-               close(STDOUT_FILENO);
-               close(STDERR_FILENO);
-               dup2(p[1], STDOUT_FILENO);
-               dup2(p[1], STDERR_FILENO);
-               close(p[0]);
-               close(p[1]);
-               return log;
+               execv(helper, argv);
+               _exit(1);
        }
        close(p[1]);
 
-       /* We failed? */
        if (*pid < 0) {
-               DEBUG(DEBUG_ERR, (__location__ " fork failed for child 
process\n"));
+               DEBUG(DEBUG_ERR, (__location__ "vfork failed for helper 
process\n"));
                close(p[0]);
                goto free_log;
        }
 
+       ctdb_track_child(ctdb, *pid);
+
        log->pfd = p[0];
        set_close_on_exec(log->pfd);
        talloc_set_destructor(log, log_context_destructor);
-       fde = event_add_fd(ctdb->ev, log, log->pfd,
-                          EVENT_FD_READ, ctdb_log_handler, log);
+       fde = tevent_add_fd(ctdb->ev, log, log->pfd, EVENT_FD_READ,
+                           ctdb_log_handler, log);
        tevent_fd_set_auto_close(fde);
 
        return log;
@@ -528,6 +545,7 @@ free_log:
        return NULL;
 }
 
+
 /*
   setup for logging of child process stdout
 */
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index acd68c8..2b52fd0 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -337,7 +337,7 @@ static void ctdb_check_health(struct event_context *ev, 
struct timed_event *te,
                DEBUG(DEBUG_NOTICE,("Recoveries finished. Running the 
\"startup\" event.\n"));
                ret = ctdb_event_script_callback(ctdb, 
                                                 
ctdb->monitor->monitor_context, ctdb_startup_callback, 
-                                                ctdb, false,
+                                                ctdb,
                                                 CTDB_EVENT_STARTUP, "%s", "");
        } else {
                int i;
@@ -362,7 +362,7 @@ static void ctdb_check_health(struct event_context *ev, 
struct timed_event *te,
                } else {
                        ret = ctdb_event_script_callback(ctdb, 
                                        ctdb->monitor->monitor_context, 
ctdb_health_callback,
-                                       ctdb, false,
+                                       ctdb,
                                        CTDB_EVENT_MONITOR, "%s", "");
                }
        }
diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c
index 414f5b1..7249f50 100644
--- a/ctdb/server/ctdb_recover.c
+++ b/ctdb/server/ctdb_recover.c
@@ -944,7 +944,6 @@ int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
        ret = ctdb_event_script_callback(ctdb, state,
                                         ctdb_end_recovery_callback, 
                                         state, 
-                                        false,
                                         CTDB_EVENT_RECOVERED, "%s", "");
 
        if (ret != 0) {
@@ -998,7 +997,7 @@ int32_t ctdb_control_start_recovery(struct ctdb_context 
*ctdb,
 
        ret = ctdb_event_script_callback(ctdb, state,
                                         ctdb_start_recovery_callback, 
-                                        state, false,
+                                        state,
                                         CTDB_EVENT_START_RECOVERY,
                                         "%s", "");
 
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index 04cdd66..0d859f9 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -510,7 +510,6 @@ static int32_t ctdb_do_takeip(struct ctdb_context *ctdb,
                                         state,
                                         ctdb_do_takeip_callback,
                                         state,
-                                        false,
                                         CTDB_EVENT_TAKE_IP,
                                         "%s %s %u",
                                         ctdb_vnn_iface_string(vnn),
@@ -651,7 +650,6 @@ static int32_t ctdb_do_updateip(struct ctdb_context *ctdb,
                                         state,
                                         ctdb_do_updateip_callback,
                                         state,
-                                        false,
                                         CTDB_EVENT_UPDATE_IP,
                                         "%s %s %s %u",
                                         state->old->name,
@@ -1024,7 +1022,6 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
 
        ret = ctdb_event_script_callback(ctdb, 
                                         state, release_ip_callback, state,
-                                        false,
                                         CTDB_EVENT_RELEASE_IP,
                                         "%s %s %u",
                                         iface,
@@ -4192,7 +4189,6 @@ int32_t ctdb_control_del_public_address(struct 
ctdb_context *ctdb, TDB_DATA inda
 
                        ret = ctdb_event_script_callback(ctdb, 
                                         mem_ctx, delete_ip_callback, mem_ctx,
-                                        false,
                                         CTDB_EVENT_RELEASE_IP,
                                         "%s %s %u",
                                         ctdb_vnn_iface_string(vnn),
@@ -4250,7 +4246,7 @@ int32_t ctdb_control_ipreallocated(struct ctdb_context 
*ctdb,
 
        ret = ctdb_event_script_callback(ctdb, state,
                                         ctdb_ipreallocated_callback, state,
-                                        false, CTDB_EVENT_IPREALLOCATED,
+                                        CTDB_EVENT_IPREALLOCATED,
                                         "%s", "");
 
        if (ret != 0) {
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index d13e944..0feb32b 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -29,23 +29,6 @@
 
 static void ctdb_event_script_timeout(struct event_context *ev, struct 
timed_event *te, struct timeval t, void *p);
 
-/*
-  ctdbd sends us a SIGTERM when we should die.
- */
-static void sigterm(int sig)
-{
-       pid_t pid;
-
-       /* all the child processes will be running in the same process group */
-       pid = getpgrp();
-       if (pid == -1) {
-               kill(-getpid(), SIGKILL);
-       } else {
-               kill(-pid, SIGKILL);
-       }
-       _exit(1);
-}
-
 /* This is attached to the event script state. */
 struct event_script_callback {
        struct event_script_callback *next, *prev;
@@ -62,7 +45,6 @@ struct ctdb_event_script_state {
        struct event_script_callback *callback;
        pid_t child;
        int fd[2];
-       bool from_user;
        enum ctdb_eventscript_call call;
        const char *options;
        struct timeval timeout;
@@ -267,122 +249,92 @@ static struct ctdb_scripts_wire 
*ctdb_get_script_list(struct ctdb_context *ctdb,
        return scripts;
 }


-- 
Samba Shared Repository

Reply via email to