void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code);
-int switch_from_server_to_client(struct ctdb_context *ctdb,
- const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
+int switch_from_server_to_client(struct ctdb_context *ctdb);
/* From server/ctdb_fork.c */
debug_extra = talloc_asprintf(NULL, "revokechild-%s:", ctdb_db->db_name);
prctl_set_comment("ctdb_revokechild");
- if (switch_from_server_to_client(ctdb, "revokechild-%s", ctdb_db->db_name) != 0) {
+ if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_ERR,("Failed to switch from server to client for revokechild process\n"));
c = 1;
goto child_finished;
* process must be created using ctdb_fork() and not fork() -
* ctdb_fork() does some necessary housekeeping.
*/
-int switch_from_server_to_client(struct ctdb_context *ctdb, const char *fmt, ...)
+int switch_from_server_to_client(struct ctdb_context *ctdb)
{
int ret;
- va_list ap;
-
- /* Add extra information so we can identify this in the logs */
- va_start(ap, fmt);
- debug_extra = talloc_strdup_append(talloc_vasprintf(NULL, fmt, ap), ":");
- va_end(ap);
/* get a new event context */
ctdb->ev = tevent_context_init(ctdb);
srandom(getpid() ^ time(NULL));
prctl_set_comment("ctdb_recovered");
- if (switch_from_server_to_client(ctdb, "recoverd") != 0) {
+ if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch recovery daemon into client mode. shutting down.\n"));
exit(1);
}
debug_extra = talloc_asprintf(NULL, "reloadips:");
prctl_set_comment("ctdb_reloadips");
- if (switch_from_server_to_client(ctdb, "reloadips-child") != 0) {
+ if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_CRIT,("ERROR: Failed to switch reloadips child into client mode\n"));
res = -1;
} else {
close(h->fd[0]);
prctl_set_comment("ctdb_traverse");
- if (switch_from_server_to_client(ctdb, "traverse_local-%s:",
- ctdb_db->db_name) != 0) {
+ if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_CRIT, ("Failed to switch traverse child into client mode\n"));
_exit(0);
}
DEBUG(DEBUG_INFO,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name));
prctl_set_comment("ctdb_vacuum");
- if (switch_from_server_to_client(ctdb, "vacuum-%s", ctdb_db->db_name) != 0) {
+ if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch vacuum daemon into client mode. Shutting down.\n"));
_exit(1);
}