summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorMirco Tischler <mt-ml@gmx.de>2013-01-17 18:55:05 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-18 11:14:00 -0500
commitef1673d16907726d83bdff2e57b5261997a85020 (patch)
tree279fb9130247928bc23a63aae0159fbf73a59544 /src/journal
parentb9893505636b77878035b342026e391e10cfbb91 (diff)
journal: log _SYSTEMD_USER_UNIT for user session units
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index ec9be65575..12a46e6bd0 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -601,8 +601,15 @@ static void dispatch_message_real(
if (cg_pid_get_unit(ucred->pid, &t) >= 0) {
unit = strappend("_SYSTEMD_UNIT=", t);
free(t);
- } else if (unit_id)
- unit = strappend("_SYSTEMD_UNIT=", unit_id);
+ } else if (cg_pid_get_user_unit(ucred->pid, &t) >= 0) {
+ unit = strappend("_SYSTEMD_USER_UNIT=", t);
+ free(t);
+ } else if (unit_id) {
+ if (session)
+ unit = strappend("_SYSTEMD_USER_UNIT=", unit_id);
+ else
+ unit = strappend("_SYSTEMD_UNIT=", unit_id);
+ }
if (unit)
IOVEC_SET_STRING(iovec[n++], unit);