mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 14:17:42 +00:00
Merge pull request #3152 from MichaelEischer/fix-backup-background-hang
backup: Fix shutdown hang when running in the background on linux
This commit is contained in:
commit
b58799d83a
8
changelog/unreleased/pull-3152
Normal file
8
changelog/unreleased/pull-3152
Normal file
@ -0,0 +1,8 @@
|
||||
Bugfix: On Linux `backup` hangs during exit when run as a background job
|
||||
|
||||
On Linux, when running in the background restic failed to stop the terminal
|
||||
output of the `backup` command after it had completed. This caused restic to
|
||||
hang until moved to the foreground. This has been fixed.
|
||||
|
||||
https://github.com/restic/restic/pull/3152
|
||||
https://forum.restic.net/t/restic-alpine-container-cron-hangs-epoll-pwait/3334
|
@ -96,11 +96,9 @@ func (t *Terminal) run(ctx context.Context) {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
if IsProcessBackground(t.fd) {
|
||||
// ignore all messages, do nothing, we are in the background process group
|
||||
continue
|
||||
}
|
||||
if !IsProcessBackground(t.fd) {
|
||||
t.undoStatus(len(status))
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user