bluechi icon indicating copy to clipboard operation
bluechi copied to clipboard

RFE: Add ListUnitFiles API

Open engelmi opened this issue 10 months ago • 0 comments

Please describe what you would like to see

This RFE resulted from https://github.com/eclipse-bluechi/bluechi/issues/887.

Based on how systemctl list-units works, it is not possible to query services that aren't reference in any way (e.g. via RequiredBy = multi-user.target) or are active/failed. systemd's ListUnitFiles API can be used to address this issue and return a list of files. So in order to enable a more complete view of available services, a new API for listing unit files should be added to BlueChi.

Please describe the solution you'd like

  • [ ] bluechi-controller: Add new API method on public DBus and delegate to bluechi-agent
  • [ ] bluechi-agent: Add new API on internal DBus and delegate to systemd bus
  • [ ] bluechictl: Add new command list-unit-files [file-name-pattern] where pattern can be used to filter by file name glob (similar to bluechictls list-units)
  • [ ] Implement integration tests
  • [ ] Extend documentation (man pages, examples, etc.)

Please describe your use case

For example, systemd services generated from quadlet files are not visible via ListUnits method (based on how systemctl list-units works). Using list-unit-files such service files can be queried as well.

engelmi avatar Apr 22 '24 06:04 engelmi