Skip to content

Replacing deferrable reboot with watchcat #1186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

AguTrachta
Copy link

This implementation covers the suggestion made here. The code configures watchcat every time lime-config is run.

For the moment deferrable-reboot has not been removed.
Please review and let me know if you think it is safe to remove deferrable-reboot entirely, or if further adjustments are needed.

@ilario
Copy link
Member

ilario commented Jun 5, 2025

Hi!
Thanks for this work!! :D

I did not test yet. Just trying to comment the code by eye, I could be wrong:

For the Makefile, there is a "new" and more compact format using the libremesh.mk file, you can see many examples in the files modified by this pull request: #1139
As this package will be just one Lua file, you can take inspiration by a simple Makefile like this one:
https://github.com/libremesh/lime-packages/blob/d1642f198ac94947d818ed5c97fbce1cd01ca996/packages/altermundi-grafana/Makefile

It would be helpful to add an example of configuration in lime-example.txt https://github.com/libremesh/lime-packages/blob/master/packages/lime-docs/files/www/docs/lime-example.txt

It looks like all the settings are currently hardcoded, is it so?
What I would allow the user to customize is:
The ping target IP (e.g. someone could ping an IP internal in the local net, which would make even more sense than pinging an IP on the internet)
The period, as maybe someone could want something longer or shorter than 6 hours.
The pingperiod of 30s is likely good for everybody... But I am not super sure of that. We can leave that hardcoded until when someone complains or we can add it as a customizable parameter.

I would not use Google's 8.8.8.8 as the default ping target. Rather, we can use the same that is in place for deferrable-reboot (4.2.2.2 b.resolvers.Level3.net) https://github.com/libremesh/lime-packages/blob/master/packages/lime-docs/files/www/docs/lime-example.txt#L25

@AguTrachta
Copy link
Author

Nice, so I have a doubt here, do we need to add a fallback configuration if it doesnt find a config hwd_watchcat in lime-community? or we leave the default open wrt config?

If we do the last option it will stay with this configuration

@ilario
Copy link
Member

ilario commented Jun 7, 2025

Nice, so I have a doubt here, do we need to add a fallback configuration if it doesnt find a config hwd_watchcat in lime-community? or we leave the default open wrt config?

If we do the last option it will stay with this configuration

In case an option is not specified in /etc/config/lime-*, it seems more than reasonable to use the fallback from the upstream package actually... Great proposal, thanks!

So, if we want to propose a default alternative to 8.8.8.8 we should include it in /etc/config/lime-defaults

Also, what about including an "enabled" true/false option? I mean: if, in the future, we decide to include watchcat by default in the firmware images, it should not run before the user chooses the target IP and explicitly decides to enable it.
That option would cause the execution (when lime-config is run) of "service watchcat enable; service watchcat start" from within the same Lua file when it is true and a "service watchcat stop; service watchcat disable" when it is false. But this can be implemented in the future: until when watchcat is not included by default in the firmware images, I believe it can be spared.

@AguTrachta
Copy link
Author

  • In these new changes I replaced the Makefile with a minimal one based on libremesh.mk
  • /etc/config/watchcat is left intact unless the admin defines config hwd_watchcat
  • And added a new example block under “Watchcat specific sections” showing exactly how to define a config hwd_watchcat

I'm still analyzing the enable option, but I wanted to make this push for you to help me testing if its possible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants