From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=altlinux.org; s=dkim; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m0Au3nJ3AcaK5pJsdqoVNxmFxjHK6hMMkrah3hMrsKk=; b=KV7K8gKyjQtIGqzITI4lLPVACD JMxntKUGJeJyCrSWNQAT2S3AV8HJcD1z1diQvNMj4/LBOJgRtBSYAIoRoTPvOlKuHIrmNa9SiMAS1 rBf1+cHSP6AnUevre5+rD11s9GLUYIWpgECPjwxE7qIKf+ZMOcYh6CteUxQDiSof3m+3gp43AWc0W vOo7G13uejMqon73FZnRLjSqmpFlNNMfahkudQeyoEf4bgqrNNXgoeP3CP+hOcHxzD0rTgJKhqf97 69AQ053nfKyR1jUh6h+BjZnInapJ5rwBFTtmDP+OzTctM/8BwiP6PNAnNd1GrDx2iSZBCwIIndYPP rf6tRcqw==; From: Arseny Maslennikov To: devel@lists.altlinux.org, ldv@altlinux.org Date: Thu, 22 Oct 2020 14:43:40 +0300 Message-Id: <20201022114343.1810141-4-arseny@altlinux.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201022114343.1810141-1-arseny@altlinux.org> References: <20201022114343.1810141-1-arseny@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 37.204.119.143 X-SA-Exim-Mail-From: arseny@altlinux.org X-SA-Exim-Version: 4.2.1 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) Cc: Arseny Maslennikov Subject: [devel] [PATCH v2 3/6] daemon: set titles for subprocesses X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2020 11:43:58 -0000 Archived-At: List-Archive: List-Post: Signed-off-by: Arseny Maslennikov --- hasher-priv/caller_server.c | 3 +++ hasher-priv/caller_task.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hasher-priv/caller_server.c b/hasher-priv/caller_server.c index abc2746..d472d9a 100644 --- a/hasher-priv/caller_server.c +++ b/hasher-priv/caller_server.c @@ -19,6 +19,8 @@ #include #include +#include + #include "priv.h" #include "xmalloc.h" #include "sockets.h" @@ -364,6 +366,7 @@ fork_server(int cl_conn, uid_t uid, gid_t gid, unsigned num) if (ret >= 0) { info("%s(%d) num=%u: start session server", caller_user, caller_uid, caller_num); + setproctitle("%s %s/%u:%u", "privileged helper for", caller_user, caller_uid, caller_num); ret = caller_server(cl_conn); info("%s(%d): finish session server", caller_user, caller_uid); } diff --git a/hasher-priv/caller_task.c b/hasher-priv/caller_task.c index 8965196..46745a2 100644 --- a/hasher-priv/caller_task.c +++ b/hasher-priv/caller_task.c @@ -16,6 +16,8 @@ #include #include +#include + #include "communication.h" #include "xmalloc.h" #include "logging.h" @@ -96,6 +98,8 @@ caller_task(struct task *task) return pid; } + setproctitle("%s for [%u:%u]: %s", "task handler", caller_uid, caller_num, task2str(task->type)); + if ((rc = reopen_iostreams(task->stdin, task->stdout, task->stderr)) < 0) exit(rc); @@ -175,6 +179,8 @@ process_caller_task(int conn, struct task *task) return pid; } + setproctitle("%s", __func__); + if ((cpid = caller_task(task)) > 0) { while (1) { pid_t w; -- 2.25.4