ctdb: Use prctl_set_comment from lib/util
authorChristof Schmitt <cs@samba.org>
Wed, 23 Sep 2015 23:10:59 +0000 (16:10 -0700)
committerAmitay Isaacs <amitay@samba.org>
Wed, 18 Nov 2015 03:05:13 +0000 (04:05 +0100)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_call.c
ctdb/server/ctdb_monitor.c
ctdb/server/ctdb_recover.c
ctdb/server/ctdb_recoverd.c
ctdb/server/ctdb_takeover.c
ctdb/server/ctdb_traverse.c
ctdb/server/ctdb_update_record.c
ctdb/server/ctdb_vacuum.c

index 6d05af8564966bd6b0111b24ec299a453025c108..db9fb6aefc591d4005ffe9cd3535f21ee527f511 100644 (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;
index 4f998d3d1f569f2009a1670770f7da604fd90872..d8eda2a11caeb9791957d99325f1683d64ea9756 100644 (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) {
index bf045c1461d7de8af92717a1ea7aeaa25d1421e5..7b34d7e2913a063ea746159be52308d83ee95ec9 100644 (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 */
index 3f0cffc36d32783ec3969ed6ab09ff0f4362fa62..c9f19fa8870ed1df6644b5bd0b6f79bea045ff5b 100644 (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);
index 6844246c2ad4d3cc2fa7403655636829e26b3752..c9179d3017399767804c4f61ce7c14f16327eb3a 100644 (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;
index 3dea3fad7c68b48223c01410121ca4f44cf908e7..73c3a066db9eb0e9825475a3dc8de9c7345c5b78 100644 (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"));
index 143520ab7b15c086e6001703c74f42cf121b1b6a..bc9c6fe06c37adc67605110f25a9fb7956f63f7d 100644 (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) {
index a81bd54b287cfc8c442944d796c195d4c49e678d..54dfe9955ab01542c8eca02351efef1dbeae4bd6 100644 (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);