Provide greenboot.target and replace greenboot-healthcheck.service by individual units
BreiteSeite opened this issue · 0 comments
Thanks for this project. I think it's a really nice idea and can be a life-saver to administrate a headless Raspberry Pi.
I wonder there is some potential to simplify the health-check execution. Disclaimer: i'm a big fan of systemd but also not very well versed in either systemd or greenbot and i'm always learning. :)
Provide greenbot.target
This can be RequiredBy=boot-complete.target
(if i understand the boot-complete.target
correctly.)
Convert the health checks to systemd.service
one-shot units
They can be RequiredBy=greenboot.target
I think the fact that greenbot itself has required.
and wanted.d
is a good indicator that it duplicates systemd logic.
This would also make greenboot-healthcheck.service
obsolete.
This would have the following benefits:
- The script doing the logging that healthchecks are run would be a bit obsolte, systemd already provide everything in the journal and tools to visualize the dependency graph (like
systemd-analyze critical-path
). - The health checks themselves have appropriate dependencies (like health-checks requiring a network can depend on
network-only.target
) - health checks would automatically run in parallel. I think ordering based on file-names does not make sense. systemd dependency and ordering should be used.
- Admins can easily disable specific health-checks (would make #119 obsolete). This also means if all health-checks that require network are disabled, boot would be way quicker because greenbot wouldn't wait for the network.
- Admins can use all the other fancy systemd functionality to extend/hook-into the integrated health checks
- It would simplify usage of greenbot, because there is only one way that would be needed to be maintained
- It abstracts away the whole shell script thing. Each healthcheck can use whatever runtime it wants. Also no more dependency on shell for boot checks is nice i guess.
- Third party checks can just require/want the greenbot.target and order themselves accordingly how they desire.
Let me know what you think. I would be also happy to try to contribute development efforts, if my freetime allows and the idea is generally accepted.