logging: Do not ignore stdout/stderr from the exec'd children
authorAmitay Isaacs <amitay@gmail.com>
Wed, 13 Mar 2013 00:46:18 +0000 (11:46 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 25 Mar 2013 06:51:37 +0000 (17:51 +1100)
To log debugging information from child processes that are started
with vfork and exec, do not set close_on_exec on STDOUT and STDERR for
that process.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 08c53ee609b80f87450a7a1d7dd24fbcdf5ab7bc)

server/ctdb_logging.c

index 19e8af7dcb7659a9480cbf62a59d2fcf0306b6db..583384bf1d70c9d7dded3c7d1015039e1ba31cdb 100644 (file)
@@ -530,11 +530,6 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb)
        close(old_stdout);
        close(old_stderr);
 
-       /* Is this correct for STDOUT and STDERR ? */
-       set_close_on_exec(STDOUT_FILENO);
-       set_close_on_exec(STDERR_FILENO);
-       set_close_on_exec(p[0]);
-
        fde = event_add_fd(ctdb->ev, ctdb->log, p[0],
                           EVENT_FD_READ, ctdb_log_handler, ctdb->log);
        tevent_fd_set_auto_close(fde);