Make the webapp a service that starts on its own #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, thanks for putting together this system! Here's a proposed change to have the webserver and "operating system" turn on at startup, and have the various messages show up in a log using
systemd
. Hope this can be useful! Below the commit message with details.These changes make the ChiBio webserver start in the background as a service after the board has been turned on
The
chibio.service
must be placed in/lib/systemd/
and enabled with the commandsystemctl enable chibio.service
The service can be stopped/started using
systemctl
:systemctl start chibio.service
systemctl stop chibio.service
systemctl status chibio.service
Messages that used to be printed to stdout are now fed into
systemd
and can be read with timestamps usingjournalctl
:journalctl -u chibio.service
journalctl -f -u chibio.service
Also added
--timeout 0
togunicorn
as our board was sometimes shutting down the webserver mid-experiment because of a timeout; gunicorn by default has a 30 seconds timeout, with this change there is no limit