mirror of
https://github.com/samba-team/samba.git
synced 2025-08-28 09:49:30 +03:00
smbd: set long process name of smbd child processes to "smbd: <CLIENT IP>"
The resulting process listings, depending on the format chosen for the process name, show the relevant smbd processes like this: $ ps faxo pid,uid,comm | egrep "\_.*smbd" | grep -v grep 1690322 0 \_ smbd 1690326 0 \_ smbd-notifyd 1690327 0 \_ smbd-cleanupd 1690337 0 \_ smbd[::1] $ ps faxo pid,uid,args | egrep "\_.*smbd" | grep -v grep 1690322 0 \_ ./bin/smbd -D 1690326 0 \_ smbd: notifyd 1690327 0 \_ smbd: cleanupd 1690337 0 \_ smbd: client [::1] Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Dec 14 02:47:24 UTC 2022 on sn-devel-184
This commit is contained in:
committed by
Jeremy Allison
parent
fc57b88e6a
commit
5955dc1e4f
@ -35,6 +35,7 @@
|
||||
#include "secrets.h"
|
||||
#include "../lib/util/memcache.h"
|
||||
#include "ctdbd_conn.h"
|
||||
#include "lib/util/util_process.h"
|
||||
#include "util_cluster.h"
|
||||
#include "printing/queue_process.h"
|
||||
#include "rpc_server/rpc_config.h"
|
||||
@ -1001,6 +1002,7 @@ static void smbd_accept_connection(struct tevent_context *ev,
|
||||
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
NTSTATUS status = NT_STATUS_OK;
|
||||
|
||||
/*
|
||||
@ -1038,6 +1040,9 @@ static void smbd_accept_connection(struct tevent_context *ev,
|
||||
smb_panic("reinit_after_fork() failed");
|
||||
}
|
||||
|
||||
print_sockaddr(addrstr, sizeof(addrstr), &addr);
|
||||
process_set_title("smbd[%s]", "client [%s]", addrstr);
|
||||
|
||||
smbd_process(ev, msg_ctx, fd, false);
|
||||
exit:
|
||||
exit_server_cleanly("end of child");
|
||||
|
Reference in New Issue
Block a user