Skip to content
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

[feature] Add SIGUSR2 which forces the reload of the config #181

Open
nemesifier opened this issue Jun 25, 2022 · 2 comments
Open

[feature] Add SIGUSR2 which forces the reload of the config #181

nemesifier opened this issue Jun 25, 2022 · 2 comments

Comments

@nemesifier
Copy link
Member

We could listen to SIGUSR2 which would be like SIGUSR1 but with the difference that the following files will be removed first:

  • /tmp/openwisp/checksum
  • /etc/openwisp/checksum

This will force the reload of the configuration.

It would be super great to also provide some sort of shortcut to send these signals to the agent, easily, with a command that we can remember, what about:

openwisp_config --check-conf
openwisp_config --force-conf

I find myself doing these kind of things all the time manually, I am sure many users do the same or struggle to find out how to do this, so if we add an easy way and document it, it will be useful.

@shwetd19
Copy link

Hey @nemesifier,

Implementation I can think of: Adding a signal handler for SIGUSR2 in the agent, and when the signal is received, delete the checksum files (/tmp/openwisp/checksum and /etc/openwisp/checksum). Additionally, also just to confirm here... adding CLI commands like openwisp_config --check-conf and openwisp_config --force-conf for ease of use, and document the new feature in the user guide can solve this manual work here..

@nemesifier
Copy link
Member Author

Hey @nemesifier,

Implementation I can think of: Adding a signal handler for SIGUSR2 in the agent, and when the signal is received, delete the checksum files (/tmp/openwisp/checksum and /etc/openwisp/checksum). Additionally, also just to confirm here... adding CLI commands like openwisp_config --check-conf and openwisp_config --force-conf for ease of use, and document the new feature in the user guide can solve this manual work here..

@shwetd19 sounds good! The agent name now is openwisp-config (before it was openwisp_config).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do (OpenWRT)
Development

No branches or pull requests

2 participants