When we create a log stream connection to journald, we pass along the
unit ID. With this change we do this only when we run as system
instance, not as user instance, to remove the ambiguity whether a user
or system unit is specified. The effect of this change is minor:
journald ignores the field anyway from clients with UID != 0. This patch
hence only fixes the unit attribution for the --user instance of the
root user.
"%i\n"
"%i\n"
"%i\n",
- context->syslog_identifier ? context->syslog_identifier : ident,
- unit->id,
+ context->syslog_identifier ?: ident,
+ MANAGER_IS_SYSTEM(unit->manager) ? unit->id : "",
context->syslog_priority,
!!context->syslog_level_prefix,
output == EXEC_OUTPUT_SYSLOG || output == EXEC_OUTPUT_SYSLOG_AND_CONSOLE,