Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-69536

systemd --user service units executed commands outputs messages that are lacking trusted properties on the journal

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.10, rhel-8.10.z
    • systemd
    • None
    • No
    • Important
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Running a script or command as a --user service, the output fails to be shown on the journal while using the --user unit name. It does show if you review the journal without filters.

      $ systemd-run --user ls /
      Running as unit: run-rfc90d1a72a7844f3aa8e3325785609f1.service
      $ journalctl --user-unit run-rfc90d1a72a7844f3aa8e3325785609f1.service
      -- Logs begin at Fri 2024-11-01 15:39:17 -03, end at Fri 2024-11-29 14:21:40 -03. --
      Nov 29 14:19:25 r810 systemd[154931]: Started /usr/bin/ls /.

       

      What is the impact of this issue to you?

      This hinders the customer ability to diagnose issues

      Please provide the package NVR for which the bug is seen:

      systemd-239-82.el8_10.2.x86_64

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1. $ systemd-run --user ls /
      2. $ journalctl --user-unit <output_from_above>

      Expected results

      1. $ systemd-run --user ls /
        Running as unit: run-r56b468a242d849f5b1d9974f914477f1.service
      2. $ journalctl --user-unit run-r56b468a242d849f5b1d9974f914477f1.service
        • Logs begin at Fri 2024-11-01 15:39:17 -03, end at Fri 2024-11-29 14:25:15 -03. –
          Nov 29 14:25:04 r810 systemd[155027]: Started /usr/bin/ls /.
          Nov 29 14:25:04 r810 ls[155119]: bin
          Nov 29 14:25:04 r810 ls[155119]: boot
          Nov 29 14:25:04 r810 ls[155119]: dev
          Nov 29 14:25:04 r810 ls[155119]: etc
          Nov 29 14:25:04 r810 ls[155119]: home
          Nov 29 14:25:04 r810 ls[155119]: lib
          Nov 29 14:25:04 r810 ls[155119]: lib64
          Nov 29 14:25:04 r810 ls[155119]: media
          Nov 29 14:25:04 r810 ls[155119]: mnt
          Nov 29 14:25:04 r810 ls[155119]: opt
          Nov 29 14:25:04 r810 ls[155119]: proc
          Nov 29 14:25:04 r810 ls[155119]: remote
          Nov 29 14:25:04 r810 ls[155119]: root
          Nov 29 14:25:04 r810 ls[155119]: run
          Nov 29 14:25:04 r810 ls[155119]: sbin
          Nov 29 14:25:04 r810 ls[155119]: srv
          Nov 29 14:25:04 r810 ls[155119]: sys
          Nov 29 14:25:04 r810 ls[155119]: tmp
          Nov 29 14:25:04 r810 ls[155119]: usr
          Nov 29 14:25:04 r810 ls[155119]: var

      Actual results

      1. $ systemd-run --user ls /
        Running as unit: run-r56b468a242d849f5b1d9974f914477f1.service
      2. $ journalctl --user-unit run-r56b468a242d849f5b1d9974f914477f1.service
        • Logs begin at Fri 2024-11-01 15:39:17 -03, end at Fri 2024-11-29 14:25:15 -03. –
          Nov 29 14:25:04 r810 systemd[155027]: Started /usr/bin/ls /.

      Additional information

      • information is available through _STREAM_ID=
        • example journal log for the output of the command:
        • {         "__CURSOR" : "s=2f2eb7d41d594bb5a32e3756a6800204;i=188847;b=df09dee79bb043cca9d3998986a42049;m=3fa0351535;t=628107ac77b5b;x=599ee38ed6646>         "__REALTIME_TIMESTAMP" : "1732901104745307",         "__MONOTONIC_TIMESTAMP" : "273270773045",         "_BOOT_ID" : "df09dee79bb043cca9d3998986a42049",         "PRIORITY" : "6",         "SYSLOG_FACILITY" : "3",         "_UID" : "1000",         "_GID" : "1000",         "_SELINUX_CONTEXT" : "unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023",         "_MACHINE_ID" : "b5839dd227444ae1b4ac41bb1954e59c",         "_HOSTNAME" : "r810",         "_TRANSPORT" : "stdout",         "SYSLOG_IDENTIFIER" : "ls",         "MESSAGE" : "var",         "_STREAM_ID" : "853fde6482394fe385cdc1aaa47b5f95",         "_PID" : "155119" }
        • There we can see "USER_UNIT" property missing on the actual command's output executed through the --user service unit.
      • example journal item of the actual --user service unit:
        • $ journalctl o json-pretty --user-unit run-r56b468a242d849f5b1d9974f914477f1.service {         "_CURSOR" : "s=2f2eb7d41d594bb5a32e3756a6800204;i=188833;b=df09dee79bb043cca9d3998986a42049;m=3fa03502ad;t=628107ac768d3;x=7704a7d5ed297d4b",         "REALTIME_TIMESTAMP" : "1732901104740563",         "_MONOTONIC_TIMESTAMP" : "273270768301",         "_BOOT_ID" : "df09dee79bb043cca9d3998986a42049",         "PRIORITY" : "6",         "SYSLOG_FACILITY" : "3",         "CODE_FILE" : "../src/core/job.c",         "CODE_LINE" : "933",         "CODE_FUNC" : "job_log_done_status_message",         "SYSLOG_IDENTIFIER" : "systemd",         "JOB_TYPE" : "start",         "JOB_RESULT" : "done",         "MESSAGE_ID" : "39f53479d3a045ac8e11786248231fbf",         "_TRANSPORT" : "journal",         "_UID" : "1000",         "_GID" : "1000",         "_COMM" : "systemd",         "_EXE" : "/usr/lib/systemd/systemd",         "_CMDLINE" : "/usr/lib/systemd/systemd --user",         "_CAP_EFFECTIVE" : "0",         "_SELINUX_CONTEXT" : "unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023",         "_AUDIT_LOGINUID" : "1000",         "_SYSTEMD_CGROUP" : "/user.slice/user-1000.slice/user@1000.service/init.scope",         "_SYSTEMD_OWNER_UID" : "1000",         "_SYSTEMD_UNIT" : "user@1000.service",         "_SYSTEMD_USER_UNIT" : "init.scope",         "_SYSTEMD_SLICE" : "user-1000.slice",         "_SYSTEMD_USER_SLICE" : ".slice",         "_MACHINE_ID" : "b5839dd227444ae1b4ac41bb1954e59c",         "_HOSTNAME" : "r810",         "MESSAGE" : "Started /usr/bin/ls /.",         "_PID" : "155027",         "_AUDIT_SESSION" : "28",         "_SYSTEMD_INVOCATION_ID" : "6d8839cd657147b2879bb9f9d548a50f",         "USER_UNIT" : "run-r56b468a242d849f5b1d9974f914477f1.service",         "USER_INVOCATION_ID" : "0b9a13f7b91f40a8b9d397e93fca0ad8",         "_SOURCE_REALTIME_TIMESTAMP" : "1732901104729630" }
      • Similar upsteam bugs reports (may or may not be related)

       

              systemd-maint systemd maint mailing list
              rhn-support-jgamba Juan Gamba
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: