Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unnecessary intermediate variables. Send SIGTERM instead of SIGKILL to terminate child kopia server process. Set Pdeathsig on Linux for child kopia server process. Trivial: reduce scope of hostFioDataPathStr variable. Trivial: rename local variable. Trivial: Use log.Fatalln instead of log + exit(1). Improve error message in robustness test to tell apart failure cause.
- Loading branch information
Julio López
committed
Dec 16, 2020
1 parent
4eb8f71
commit 3795ffc
Showing
6 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// +build !linux | ||
|
||
package kopiarunner | ||
|
||
import "os/exec" | ||
|
||
func setpdeath(c *exec.Cmd) *exec.Cmd { | ||
return c | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package kopiarunner | ||
|
||
import ( | ||
"os/exec" | ||
"syscall" | ||
) | ||
|
||
func setpdeath(c *exec.Cmd) *exec.Cmd { | ||
if c == nil { | ||
return nil | ||
} | ||
|
||
if c.SysProcAttr == nil { | ||
c.SysProcAttr = &syscall.SysProcAttr{} | ||
} | ||
|
||
c.SysProcAttr.Pdeathsig = syscall.SIGTERM | ||
|
||
return c | ||
} |