beesd@.service: add shutdown ordering to prevent EBUSY on unmount - #1
Merged
Conversation
There was a problem hiding this comment.
⚠️ Not ready to approve
The WantedBy=multi-user.target change is an unmentioned behavioral change that should be justified/documented or reverted before approval.
Pull request overview
Updates the systemd template unit for beesd@ to improve shutdown ordering and stop behavior so filesystems managed/held open by beesd are less likely to fail unmount with EBUSY during shutdown.
Changes:
- Add
After=local-fs.targetandBefore=umount.targetto improve ordering betweenbeesdand shutdown unmounting. - Increase shutdown grace period via
TimeoutStopSec=300. - Minor unit-file adjustments (comment typo fix; change
WantedBytarget).
File summaries
| File | Description |
|---|---|
| scripts/beesd@.service.in | Adjusts systemd unit ordering and stop timeout to reduce shutdown-time unmount failures. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Description=Bees (%i) | ||
| Documentation=https://github.com/Zygo/bees | ||
| After=sysinit.target | ||
| # Prevents bees from still running while scanned FS is being unmounted |
|
|
||
| [Install] | ||
| WantedBy=basic.target | ||
| WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Without Before=umount.target, systemd has no ordering guarantee between
stopping beesd and unmounting the filesystems it holds open, causing
unmount failures with EBUSY during shutdown.
On my system, with beesd running against a filesystem mounted at
/mnt/games, systemd would attempt to unmount the filesystem while beesd
still held open file descriptors, resulting in:
umount: /mnt/games: target is busy.
Add Before=umount.target so beesd is stopped before systemd begins
deactivating mount units. Also add After=local-fs.target so beesd does
not start before local filesystems are ready, and TimeoutStopSec=300 to
allow sufficient time for the hash table to flush before escalating to
SIGKILL.