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

[change] Use SIGUSR1 signal to reload config during push updates #478

Closed
nemesifier opened this issue Jun 3, 2021 · 0 comments · Fixed by #485
Closed

[change] Use SIGUSR1 signal to reload config during push updates #478

nemesifier opened this issue Jun 3, 2021 · 0 comments · Fixed by #485

Comments

@nemesifier
Copy link
Member

Now that we can trigger openwisp-config to download and apply the config with a SIGUSR1 signal, we can use this new and better way during push updates.

This is what we use nowadays:

def update_config(self):
_, exit_code = self.exec_command(
'test -f /tmp/openwisp/applying_conf', exit_codes=[0, 1]
)
if exit_code == 1:
self.exec_command('/etc/init.d/openwisp_config restart')
else:
logger.info('Configuration already being applied')

We would have to change the code to check if the openwisp-config version is higher or equal to 0.6.0a, in that case we can use the new method (we have to find the pid of openwisp-config and then call kill -SIGUSR1 <pid>.

@nemesifier nemesifier added this to Backlog in OpenWISP Priorities for next releases via automation Jun 3, 2021
OpenWISP Priorities for next releases automation moved this from Backlog to Done Jun 8, 2021
nemesifier pushed a commit that referenced this issue Jun 8, 2021
Use SIGUSR1 signal if the openwisp-config version is higher than 0.6.0a.
The old behavior is maintained for old versions. 

Closes #478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant