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

Please add machine-readable output to dnf needs-restarting

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • rhel-10.0.beta
    • dnf-plugins-core
    • No
    • None
    • sst_cs_software_management
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      RHEL 10 recently removed tracer, so I am looking for how to replace its functionality in Cockpit. We used tracer to determine what needs to happen after applying OS updates.

      The current output is very oriented to human text formatting, and is hard to parse mechanically, from e.g. Ansible or Cockpit. In Cockpit we used tracer's python API, but that's not available for dnf needs-restarting.

      The hardest is kernel updates: After that, dnf needs-restarting is empty, but --reboothint has

      Core libraries or services have been updated since boot-up:
        * dbus
        * kernel
        * kernel-core
      
      Reboot is required to fully utilize these updates.
      More information: https://access.redhat.com/solutions/27943
      

      Parsing that mechanically is very error-prone. Can you please add a --json or similarly structured output? E.g.

      {"type": "reboot", "packages": ["dbus", "kernel", "kernel-core"], "documentation": "https://access.redhat.com/solutions/27943"}
      

      (or split it up by package to be more consistent with the other formats below – that's not very important)

      This also applies to other updates. For example, the process list looks like this:

      2489 : /usr/bin/podman --log-level=info system service
      

      This is fairly easy to machine read still, but having this output more structured as JSON would be helpful:

      [{"type": "process", "pid": 2489, "cmdline": ["/usr/bin/podman", "--log-level=info", "system", "service"]}, {...}, ...]
      

      Likewise, --services could look like

      [{"type": "unit", "unit": "podman.service"}, {...}, ...]
      

      Thanks!

            packaging-team-maint packaging-team-maint
            rhn-engineering-mpitt Martin Pitt
            packaging-team-maint packaging-team-maint
            Software Management QE Software Management QE
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: