| From dbf41699c4e6135ce1764298793ab57573f21dbf Mon Sep 17 00:00:00 2001 |
| From: Chris Morin <cmtm@google.com> |
| Date: Mon, 25 Feb 2019 11:28:29 -0800 |
| Subject: [PATCH] journal: allow setting maximum log level by PID instead of |
| unit |
| |
| --- |
| src/journal/journald-context.c | 9 ++++----- |
| 1 file changed, 4 insertions(+), 5 deletions(-) |
| |
| diff --git a/src/journal/journald-context.c b/src/journal/journald-context.c |
| index 7c51f2f633..3d30b797ef 100644 |
| --- a/src/journal/journald-context.c |
| +++ b/src/journal/journald-context.c |
| @@ -353,13 +353,12 @@ static int client_context_read_log_level_max( |
| ClientContext *c) { |
| |
| _cleanup_free_ char *value = NULL; |
| - const char *p; |
| + _cleanup_free_ char *p; |
| int r, ll; |
| |
| - if (!c->unit) |
| - return 0; |
| - |
| - p = strjoina("/run/systemd/units/log-level-max:", c->unit); |
| + r = asprintf(&p, "/run/systemd/journal/pids/log-level-max:"PID_FMT, c->pid); |
| + if (r < 0) |
| + return -ENOMEM; |
| r = readlink_malloc(p, &value); |
| if (r < 0) |
| return r; |
| -- |
| 2.21.0.1020.gf2820cf01a-goog |
| |