summaryrefslogtreecommitdiffstats
path: root/ctdb/include/ctdb_private.h
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2012-05-03 11:42:41 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2012-05-03 14:03:26 +1000
commita57eba2bb49b32f3dc69542de69b8b74ec9d3d09 (patch)
tree020fe37817cc3736da55a60b7e9912de23a91b9b /ctdb/include/ctdb_private.h
parent85432ecc5383fe4aa0fc1af9d816b17cc0629f1e (diff)
downloadsamba-a57eba2bb49b32f3dc69542de69b8b74ec9d3d09.tar.gz
samba-a57eba2bb49b32f3dc69542de69b8b74ec9d3d09.tar.xz
samba-a57eba2bb49b32f3dc69542de69b8b74ec9d3d09.zip
Track all child process so we never send a signal to an unrelated process (our child died and kernel wrapped the pid-space and reused the pid for a different process
Wrap all creation of child processes inside ctdb_fork() which is used to track all processes we have spawned. Capture SIGCHLD to track also which child processes have terminated. Wrap kill() inside ctdb_kill() and make sure that we never send a !0 signal to a child process pid that has already terminated (and might have been replaced with a (This used to be ctdb commit f73a4b1495830bcdd094a93732a89dd53b3c2f78)
Diffstat (limited to 'ctdb/include/ctdb_private.h')
-rw-r--r--ctdb/include/ctdb_private.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index d973fcc54ff..086e427baf2 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -501,6 +501,7 @@ struct ctdb_context {
struct ctdb_reloadips_handle *reload_ips;
const char *public_addresses_file;
+ struct trbt_tree *child_processes;
};
struct ctdb_db_context {
@@ -1031,7 +1032,11 @@ void ctdb_node_connected(struct ctdb_node *node);
bool ctdb_blocking_freeze(struct ctdb_context *ctdb);
void ctdb_set_scheduler(struct ctdb_context *ctdb);
void ctdb_restore_scheduler(struct ctdb_context *ctdb);
+
+struct tevent_signal *ctdb_init_sigchld(struct ctdb_context *ctdb);
pid_t ctdb_fork(struct ctdb_context *ctdb);
+int ctdb_kill(struct ctdb_context *ctdb, pid_t pid, int signum);
+
int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
struct ctdb_req_control *c,
TDB_DATA indata,