insights-core
insights-core copied to clipboard
Insights doesn't gather local modifications of systemd unit files
I've noticed that insights parsers for systemd unit files obtain data mostly using simple_file()
spec. This is probably not the best solution. systemd unit files can reside in multiple locations in the filesystem.
Most commonly unit files get copied to /etc/systemd/system/
directory for local modifications and such unit file then takes precedence over the unit file with the same name in /usr/lib/systemd/system
. IOW, by gathering unit file from /usr
we are pulling in old version which is most likely not running anymore.
Also, unit files can be extended using drop-in configuration snippets. These extensions are again not captured by parsing single file.
I think that all parsers which now use simple_file("/usr/lib/systemd/system/<unit>)
should be patched to use simple_command("/usr/bin/systemctl cat <unit>")
instead.