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=mzxuG1x96kN+WZLiuHNnc0cTuliO44iTsEpZiNlvC1I=; b=JJOyNmLX8cUaB3Sv+ZVZ1S1rWe 7lYlg918o2KJJUHxCEEVcqK4f85hcX++e7bXrHevd/z1IfXs4Bg/OTldS51olHFnxYs0SXm0HNH08 Tlby/mg2n6UW5IcTZO67ixpETO20f0+053ETHCtwfLUC0Xb/jkuXCrQBuM/yTByXt94cxeYaEoBVh c3YVQsYJ7x+UNo4IewCf+1PDrpspqI3oGG8oh+lKchT6ZhZPTSSJ63TJVLKgV92tFLwQ4OYImEA3B BfGeGokVm3awsiHkWRTEGDma9ieqiB14g5S32T8X8sXXgDr+vfZ1ktaUea6Hk8MC+wCv1/Le1Xf9F 9h2nMIFg==; From: Arseny Maslennikov To: devel@lists.altlinux.org Date: Tue, 24 Aug 2021 11:24:34 +0300 Message-Id: <20210824082436.1555890-6-arseny@altlinux.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210824082436.1555890-1-arseny@altlinux.org> References: <20210824082436.1555890-1-arseny@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 10.15.13.28 X-SA-Exim-Mail-From: arseny@altlinux.org X-SA-Exim-Version: 4.2.1 X-SA-Exim-Scanned: No (on mail.cs.msu.ru); Unknown failure Cc: Arseny Maslennikov Subject: [devel] [PATCH hasher-priv v3 5/7] 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: Tue, 24 Aug 2021 08:25:14 -0000 Archived-At: List-Archive: List-Post: Signed-off-by: Arseny Maslennikov --- hasher-priv/caller_task.c | 6 ++++++ hasher-priv/hasher-privd.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/hasher-priv/caller_task.c b/hasher-priv/caller_task.c index 7a9fc98..0a37977 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" @@ -100,6 +102,8 @@ spawn_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); @@ -187,6 +191,8 @@ process_cmd_task_run(struct hadaemon* d, int conn, struct task *task) if (d->fd_conn >= 0) close(d->fd_conn); + setproctitle("%s", __func__); + if ((cpid = spawn_caller_task(task)) > 0) { while (1) { pid_t w; diff --git a/hasher-priv/hasher-privd.c b/hasher-priv/hasher-privd.c index 06f2811..2cc7588 100644 --- a/hasher-priv/hasher-privd.c +++ b/hasher-priv/hasher-privd.c @@ -71,6 +71,8 @@ spawn_caller_server(struct hadaemon* d, int cl_conn, struct session *a) goto out_send_failure; } + setproctitle("%s %s/%u:%u", "privileged helper for", caller_user, caller_uid, caller_num); + info("%s(%d) num=%u: starting session server", caller_user, caller_uid, caller_num); struct hadaemon sh = {}; -- 2.32.0