summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-04 15:35:30 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-04 15:35:30 +0100
commit94fb446e55babb713fb24850455627acf30d999b (patch)
treeb69d30f7e36ce6b288fb3df5f2d699c83a1f835e /src/journal
parente91af489a25e8bb65016a63f533ae28a505119ef (diff)
journald: store _SYSTEMD_UNIT= instead of _SYSTEMD_SERVICE= field, since processes might also be related to mount, swap or socket units, not just services
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald.c12
-rw-r--r--src/journal/sd-journal.h1
2 files changed, 6 insertions, 7 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 47fe6edb0c..b029ab9781 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -431,7 +431,7 @@ static void dispatch_message_real(Server *s,
*comm = NULL, *cmdline = NULL, *hostname = NULL,
*audit_session = NULL, *audit_loginuid = NULL,
*exe = NULL, *cgroup = NULL, *session = NULL,
- *owner_uid = NULL, *service = NULL;
+ *owner_uid = NULL, *unit = NULL;
char idbuf[33];
sd_id128_t id;
@@ -515,12 +515,12 @@ static void dispatch_message_real(Server *s,
IOVEC_SET_STRING(iovec[n++], session);
}
- if (sd_pid_get_service(ucred->pid, &t) >= 0) {
- service = strappend("_SYSTEMD_SERVICE=", t);
+ if (sd_pid_get_unit(ucred->pid, &t) >= 0) {
+ unit = strappend("_SYSTEMD_UNIT=", t);
free(t);
- if (service)
- IOVEC_SET_STRING(iovec[n++], service);
+ if (unit)
+ IOVEC_SET_STRING(iovec[n++], unit);
}
if (sd_pid_get_owner_uid(ucred->uid, &owner) >= 0)
@@ -596,7 +596,7 @@ retry:
free(cgroup);
free(session);
free(owner_uid);
- free(service);
+ free(unit);
}
static void dispatch_message(Server *s,
diff --git a/src/journal/sd-journal.h b/src/journal/sd-journal.h
index d7e2528a35..87da17ddc6 100644
--- a/src/journal/sd-journal.h
+++ b/src/journal/sd-journal.h
@@ -35,7 +35,6 @@
* - OR of matches is borked...
* - extend hash tables table as we go
* - accelerate looking for "all hostnames" and suchlike.
- * - hookup with systemctl
* - handle incomplete header
*
* - local deserializer