lichess-org / lichess-org/fishnet
Add graceful shutdown to systemd unit
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 934
- Forks
- 115
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 2
Description
It's a bit hacky to get around the lack of asynchronous stop commands. But I've got something like this to give a 5 minute window to the process to finish any remaining work.
```
[Service]
ExecStart=/home/fishnet/fishnet --auto-update --conf /home/fishnet/fishnet.ini run
ExecStop=/bin/kill -INT "$MAINPID"
ExecStop=/usr/bin/sh -c 'while kill -0 "$MAINPID" 2>/dev/null; do sleep 1; done'
KillMode=mixed
TimeoutStopSec=300
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the systemd unit for the fishnet service and review its current stop behavior. Compare it with the issue's ExecStop, KillMode, and TimeoutStopSec example; done means the service can receive SIGINT and wait up to five minutes for remaining work before stopping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100