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:
parent
9ec0938590
commit
03b27bd139
@ -30,6 +30,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.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]);
|
close(rc->fd[0]);
|
||||||
debug_extra = talloc_asprintf(NULL, "revokechild-%s:", ctdb_db->db_name);
|
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) {
|
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"));
|
DEBUG(DEBUG_ERR,("Failed to switch from server to client for revokechild process\n"));
|
||||||
c = 1;
|
c = 1;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
|
|
||||||
@ -104,7 +105,7 @@ void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event)
|
|||||||
if (child == 0) {
|
if (child == 0) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ctdb_set_process_name("ctdb_notification");
|
prctl_set_comment("ctdb_notification");
|
||||||
debug_extra = talloc_asprintf(NULL, "notification-%s:", event);
|
debug_extra = talloc_asprintf(NULL, "notification-%s:", event);
|
||||||
ret = ctdb_run_notification_script_child(ctdb, event);
|
ret = ctdb_run_notification_script_child(ctdb, event);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.h"
|
#include "ctdb_client.h"
|
||||||
@ -633,7 +634,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
|
|||||||
char cc = 0;
|
char cc = 0;
|
||||||
close(state->fd[0]);
|
close(state->fd[0]);
|
||||||
|
|
||||||
ctdb_set_process_name("ctdb_recmode");
|
prctl_set_comment("ctdb_recmode");
|
||||||
debug_extra = talloc_asprintf(NULL, "set_recmode:");
|
debug_extra = talloc_asprintf(NULL, "set_recmode:");
|
||||||
/* Daemon should not be able to get the recover lock,
|
/* Daemon should not be able to get the recover lock,
|
||||||
* as it should be held by the recovery master */
|
* as it should be held by the recovery master */
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.h"
|
#include "ctdb_client.h"
|
||||||
@ -4074,7 +4075,7 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb)
|
|||||||
|
|
||||||
srandom(getpid() ^ time(NULL));
|
srandom(getpid() ^ time(NULL));
|
||||||
|
|
||||||
ctdb_set_process_name("ctdb_recovered");
|
prctl_set_comment("ctdb_recovered");
|
||||||
if (switch_from_server_to_client(ctdb, "recoverd") != 0) {
|
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"));
|
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch recovery daemon into client mode. shutting down.\n"));
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.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]);
|
close(h->fd[0]);
|
||||||
debug_extra = talloc_asprintf(NULL, "reloadips:");
|
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) {
|
if (switch_from_server_to_client(ctdb, "reloadips-child") != 0) {
|
||||||
DEBUG(DEBUG_CRIT,("ERROR: Failed to switch reloadips child into client mode\n"));
|
DEBUG(DEBUG_CRIT,("ERROR: Failed to switch reloadips child into client mode\n"));
|
||||||
res = -1;
|
res = -1;
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.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]);
|
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:",
|
if (switch_from_server_to_client(ctdb, "traverse_local-%s:",
|
||||||
ctdb_db->db_name) != 0) {
|
ctdb_db->db_name) != 0) {
|
||||||
DEBUG(DEBUG_CRIT, ("Failed to switch traverse child into client mode\n"));
|
DEBUG(DEBUG_CRIT, ("Failed to switch traverse child into client mode\n"));
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "lib/tdb_wrap/tdb_wrap.h"
|
#include "lib/tdb_wrap/tdb_wrap.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.h"
|
#include "ctdb_client.h"
|
||||||
@ -265,7 +266,7 @@ static struct childwrite_handle *ctdb_childwrite(
|
|||||||
char c = 0;
|
char c = 0;
|
||||||
|
|
||||||
close(result->fd[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);
|
debug_extra = talloc_asprintf(NULL, "childwrite-%s:", ctdb_db->db_name);
|
||||||
ret = ctdb_persistent_store(state);
|
ret = ctdb_persistent_store(state);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "lib/util/dlinklist.h"
|
#include "lib/util/dlinklist.h"
|
||||||
#include "lib/util/debug.h"
|
#include "lib/util/debug.h"
|
||||||
#include "lib/util/samba_util.h"
|
#include "lib/util/samba_util.h"
|
||||||
|
#include "lib/util/util_process.h"
|
||||||
|
|
||||||
#include "ctdb_private.h"
|
#include "ctdb_private.h"
|
||||||
#include "ctdb_client.h"
|
#include "ctdb_client.h"
|
||||||
@ -1507,7 +1508,7 @@ static void ctdb_vacuum_event(struct tevent_context *ev,
|
|||||||
close(child_ctx->fd[0]);
|
close(child_ctx->fd[0]);
|
||||||
|
|
||||||
DEBUG(DEBUG_INFO,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name));
|
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) {
|
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"));
|
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch vacuum daemon into client mode. Shutting down.\n"));
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user