summaryrefslogtreecommitdiff
path: root/src/core/execute.h
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-06-21 16:40:47 -0400
committerLennart Poettering <lennart@poettering.net>2012-06-22 00:14:08 +0200
commit62bca2c657bf95fd1f69935eef09915afa5c69d9 (patch)
tree7b961f5226951bea9a7470f2ecbaedbe588c6287 /src/core/execute.h
parent3b0810c53c6adfa2f436540369b8969ae75d7fcf (diff)
journal: set the _SYSTEMD_UNIT field for messages from terminated processes
As described in https://bugs.freedesktop.org/show_bug.cgi?id=50184 the journal currently doesn't set fields such as _SYSTEMD_UNIT properly for messages coming from processes that have already terminated. This means among other things that "systemctl status" may not show some of the output of services that wrote messages just before they exited. This patch fixes this by having processes that log to the journal write their unit identifier to journald when the connection to /run/systemd/journal/stdout is opened. Journald stores the unit ID and uses it to fill in _SYSTEMD_UNIT when it cannot be obtained normally (i.e. from the cgroup). To prevent impersonating another unit, this information is only used when the caller is root. This doesn't fix the general problem of getting metadata about messages from terminated processes (which requires some kernel support), but it allows "systemctl status" and similar queries to do the Right Thing for units that log via stdout/stderr.
Diffstat (limited to 'src/core/execute.h')
-rw-r--r--src/core/execute.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/execute.h b/src/core/execute.h
index 6c68169a84..2083c2971b 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -192,6 +192,7 @@ int exec_spawn(ExecCommand *command,
struct CGroupBonding *cgroup_bondings,
struct CGroupAttribute *cgroup_attributes,
const char *cgroup_suffix,
+ const char *unit_id,
int pipe_fd[2],
pid_t *ret);