Skip to content

Commit 0780443

Browse files
committed
sdjournal: export SYSLOG_IDENTIFIER
rkt needs this because there's a race where short-lived non-root processes make the journal unable to get all their information (i.e. the SYSTEMD_UNIT). We work around it by using SYSLOG_IDENTIFIER.
1 parent 0dbfc16 commit 0780443

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

sdjournal/journal.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,15 @@ var libsystemdFunctions = map[string]unsafe.Pointer{}
217217
// Journal entry field strings which correspond to:
218218
// http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
219219
const (
220-
SD_JOURNAL_FIELD_SYSTEMD_UNIT = "_SYSTEMD_UNIT"
221-
SD_JOURNAL_FIELD_MESSAGE = "MESSAGE"
222-
SD_JOURNAL_FIELD_PID = "_PID"
223-
SD_JOURNAL_FIELD_UID = "_UID"
224-
SD_JOURNAL_FIELD_GID = "_GID"
225-
SD_JOURNAL_FIELD_HOSTNAME = "_HOSTNAME"
226-
SD_JOURNAL_FIELD_MACHINE_ID = "_MACHINE_ID"
227-
SD_JOURNAL_FIELD_TRANSPORT = "_TRANSPORT"
220+
SD_JOURNAL_FIELD_SYSTEMD_UNIT = "_SYSTEMD_UNIT"
221+
SD_JOURNAL_FIELD_SYSLOG_IDENTIFIER = "SYSLOG_IDENTIFIER"
222+
SD_JOURNAL_FIELD_MESSAGE = "MESSAGE"
223+
SD_JOURNAL_FIELD_PID = "_PID"
224+
SD_JOURNAL_FIELD_UID = "_UID"
225+
SD_JOURNAL_FIELD_GID = "_GID"
226+
SD_JOURNAL_FIELD_HOSTNAME = "_HOSTNAME"
227+
SD_JOURNAL_FIELD_MACHINE_ID = "_MACHINE_ID"
228+
SD_JOURNAL_FIELD_TRANSPORT = "_TRANSPORT"
228229
)
229230

230231
// Journal event constants

0 commit comments

Comments
 (0)