From: Ralph Boehme Date: Fri, 2 Dec 2022 14:39:25 +0000 (+0100) Subject: s4/samba: use process_set_title() X-Git-Tag: talloc-2.4.0~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b62dfa68d07a2cdec76b635e82fd9b099a43c41;p=thirdparty%2Fsamba.git s4/samba: use process_set_title() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source4/samba/process_prefork.c b/source4/samba/process_prefork.c index f2927efbb06..35145c7403d 100644 --- a/source4/samba/process_prefork.c +++ b/source4/samba/process_prefork.c @@ -293,12 +293,8 @@ static void prefork_fork_master( } pid = getpid(); - setproctitle("task[%s] pre-fork master", service_name); - /* - * We must fit within 15 chars of text or we will truncate, so - * we put the constant part last - */ - prctl_set_comment("%s[master]", service_name); + + process_set_title("%s[master]", "task[%s] pre-fork master", service_name); /* * this will free all the listening sockets and all state that @@ -753,16 +749,12 @@ static void prefork_fork_worker(struct task_server *task, free(w); TALLOC_FREE(ev); - setproctitle("task[%s] pre-forked worker(%d)", - service_name, - pd->instances); - /* - * We must fit within 15 chars of text or we will truncate, so - * we put child number last - */ - prctl_set_comment("%s(%d)", + + process_set_title("%s(%d)", + "task[%s] pre-forked worker(%d)", service_name, pd->instances); + prefork_reload_after_fork(); if (service_details->post_fork != NULL) { service_details->post_fork(task, pd); diff --git a/source4/samba/process_standard.c b/source4/samba/process_standard.c index 396054dbc9d..33b11a61df4 100644 --- a/source4/samba/process_standard.c +++ b/source4/samba/process_standard.c @@ -341,13 +341,8 @@ static void standard_accept_connection( proc_ctx->forked_on_accept = true; pid = getpid(); - setproctitle("task[%s] standard worker", proc_ctx->name); - /* - * We must fit within 15 chars of text or we will truncate, so - * we put the constant part last - */ - prctl_set_comment("%s[work]", proc_ctx->name); + process_set_title("%s[work]", "task[%s] standard worker", proc_ctx->name); /* This is now the child code. We need a completely new event_context to work with */ @@ -509,12 +504,7 @@ static void standard_new_task(struct tevent_context *ev, smb_panic("Failed to add SIGTERM handler after fork"); } - setproctitle("task[%s]", service_name); - /* - * We must fit within 15 chars of text or we will truncate, so - * we put the constant part last - */ - prctl_set_comment("%s[task]", service_name); + process_set_title("%s[task]", "task[%s]", service_name); force_check_log_size();