1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb: Use prctl_set_comment from lib/util

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Christof Schmitt 2015-09-23 16:10:59 -07:00 committed by Amitay Isaacs
parent 9ec0938590
commit 03b27bd139
8 changed files with 16 additions and 8 deletions

View File

@ -30,6 +30,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -1887,7 +1888,7 @@ int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_contex
close(rc->fd[0]);
debug_extra = talloc_asprintf(NULL, "revokechild-%s:", ctdb_db->db_name);
ctdb_set_process_name("ctdb_revokechild");
prctl_set_comment("ctdb_revokechild");
if (switch_from_server_to_client(ctdb, "revokechild-%s", ctdb_db->db_name) != 0) {
DEBUG(DEBUG_ERR,("Failed to switch from server to client for revokechild process\n"));
c = 1;

View File

@ -28,6 +28,7 @@
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
@ -104,7 +105,7 @@ void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event)
if (child == 0) {
int ret;
ctdb_set_process_name("ctdb_notification");
prctl_set_comment("ctdb_notification");
debug_extra = talloc_asprintf(NULL, "notification-%s:", event);
ret = ctdb_run_notification_script_child(ctdb, event);
if (ret != 0) {

View File

@ -31,6 +31,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -633,7 +634,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
char cc = 0;
close(state->fd[0]);
ctdb_set_process_name("ctdb_recmode");
prctl_set_comment("ctdb_recmode");
debug_extra = talloc_asprintf(NULL, "set_recmode:");
/* Daemon should not be able to get the recover lock,
* as it should be held by the recovery master */

View File

@ -32,6 +32,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -4074,7 +4075,7 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb)
srandom(getpid() ^ time(NULL));
ctdb_set_process_name("ctdb_recovered");
prctl_set_comment("ctdb_recovered");
if (switch_from_server_to_client(ctdb, "recoverd") != 0) {
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch recovery daemon into client mode. shutting down.\n"));
exit(1);

View File

@ -30,6 +30,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -4518,7 +4519,7 @@ int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb, struct ctdb_re
close(h->fd[0]);
debug_extra = talloc_asprintf(NULL, "reloadips:");
ctdb_set_process_name("ctdb_reloadips");
prctl_set_comment("ctdb_reloadips");
if (switch_from_server_to_client(ctdb, "reloadips-child") != 0) {
DEBUG(DEBUG_CRIT,("ERROR: Failed to switch reloadips child into client mode\n"));
res = -1;

View File

@ -30,6 +30,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -217,7 +218,7 @@ static struct ctdb_traverse_local_handle *ctdb_traverse_local(struct ctdb_db_con
close(h->fd[0]);
ctdb_set_process_name("ctdb_traverse");
prctl_set_comment("ctdb_traverse");
if (switch_from_server_to_client(ctdb, "traverse_local-%s:",
ctdb_db->db_name) != 0) {
DEBUG(DEBUG_CRIT, ("Failed to switch traverse child into client mode\n"));

View File

@ -28,6 +28,7 @@
#include "lib/tdb_wrap/tdb_wrap.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -265,7 +266,7 @@ static struct childwrite_handle *ctdb_childwrite(
char c = 0;
close(result->fd[0]);
ctdb_set_process_name("ctdb_write_persistent");
prctl_set_comment("ctdb_write_persistent");
debug_extra = talloc_asprintf(NULL, "childwrite-%s:", ctdb_db->db_name);
ret = ctdb_persistent_store(state);
if (ret != 0) {

View File

@ -31,6 +31,7 @@
#include "lib/util/dlinklist.h"
#include "lib/util/debug.h"
#include "lib/util/samba_util.h"
#include "lib/util/util_process.h"
#include "ctdb_private.h"
#include "ctdb_client.h"
@ -1507,7 +1508,7 @@ static void ctdb_vacuum_event(struct tevent_context *ev,
close(child_ctx->fd[0]);
DEBUG(DEBUG_INFO,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name));
ctdb_set_process_name("ctdb_vacuum");
prctl_set_comment("ctdb_vacuum");
if (switch_from_server_to_client(ctdb, "vacuum-%s", ctdb_db->db_name) != 0) {
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch vacuum daemon into client mode. Shutting down.\n"));
_exit(1);