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

Create reload.sh #1060

Merged
merged 7 commits into from
Mar 21, 2022
Merged

Create reload.sh #1060

merged 7 commits into from
Mar 21, 2022

Conversation

EricClaeys
Copy link
Collaborator

This PR creates scripts/reload.sh which sends a SIGUSR1 signal to the children of the "allsky.sh" program, which will usually be the capture or capture_RPiHQ command. They then display an "Allsky is restarting" message, then exit, which causes the service to be restarted. This is nicer and more informative than having an "Allsky is not running" message followed by "Allsky is starting".

The modified "allsky.service" file calls reload.sh when sudo systemctl reload allsky is executed.

A future PR will have the WebUI invoke reload when settings change, rather than doing a "restart", which causes the two messages to be displayed. Unfortunately the version of systemctl that comes with Buster doesn't support sending a different signal when "status" is executed. If it did, reload.sh wouldn't be needed (although the updated "allsky.service" file would be).

Reloading Allsky instead of stopping and restarting allows Allsky to display a "Allsky is restarting" message instead of "Allsky is not running" then "Allsky is starting" messages.
Unfortunately the `RestartKillSignal` option isn't implemented in the systemd version 2.4.1 that's on Buster (not sure about Bullseye) so a workaround is used via the new scripts/reload.sh program.
reload.sh is called when `sudo systemctl reload allsky` is executed.  Allsky must be running for that command to work.
shellcheck recommended this
Use the more-common SIGHUP to signal the program should reload, rather than SIGUSER1.
Copy link
Collaborator

@thomasjacquin thomasjacquin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested on my setup but that looks good to me!

@EricClaeys EricClaeys merged commit 6015e9e into master Mar 21, 2022
@EricClaeys EricClaeys deleted the reload.sh branch March 21, 2022 17:06
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