fedora-iot / greenboot

Generic Health Checking Framework for systemd
GNU Lesser General Public License v2.1
101 stars 29 forks source link

Run scripts under /usr/lib/greenboot #97

Closed eric-ch closed 1 year ago

eric-ch commented 1 year ago

This is an RFC as I may be misunderstanding the file-hierarchy, but I thought it would be clearer to ask with these associated changes. I used systemd file-hierarchy as a reference point. The documentation of {greenboot} did not mention /usr/lib/greenboot/{green,red}.d, yet the specfile lists them.

The specfile creates:

Yet "/usr/libexec/greenboot/greenboot [green|red]" will not run the scripts in these directories. Add and run them before the ones in /etc.

miabbott commented 1 year ago

@say-paul could you review this one, too?

say-paul commented 1 year ago

LGTM , I agree with @miabbott to add some test for this.

eric-ch commented 1 year ago

@miabbott, @say-paul thanks for the review!

Since some unit-tests already checked for vendor and system specific scripts (/usr/lib vs /etc) I tried extending that. I am happy to revisit this if that is too intrusive.

Also I noticed that one unit test mentioned that all scripts under {/usr/lib,/etc}/greenboot/check/required.d should run, even if one failed. It appeared that was not tested for all the directory hierarchies and greenboot would skip the scripts under /etc if any under /usr/lib failed. The last commit attends that, taking the description in the unit test as the reference.

say-paul commented 1 year ago

@eric-ch Nice Catch, Tests looks good to me.

ericcurtin commented 1 year ago

LGTM

eric-ch commented 1 year ago

Hi @say-paul , @miabbott, gentle ping unless this has fallen out of favor. Is there anything I can do to help moving this along?

say-paul commented 1 year ago

cc @nullr0ute