From 28e7e9edbbcf7ebb50ed671866e7a43359017dfc Mon Sep 17 00:00:00 2001 From: Liam Haworth Date: Fri, 18 Oct 2019 01:56:41 +1100 Subject: [PATCH] bugfix(unix): Check for and ingore "Operating in progress" (#182) Added some checking in the stderr reading of `run` in `service_unix` to identify if the output ended with `Operation now in progress` is the command was `launchctl`. If the output has the suffix it is ignored and treated as a non-error, all other standard error output is treaded as an error like normal. --- service_unix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service_unix.go b/service_unix.go index 58a3f20..1b4be3b 100644 --- a/service_unix.go +++ b/service_unix.go @@ -7,6 +7,7 @@ package service import ( + "bytes" "fmt" "io" "io/ioutil" @@ -99,7 +100,7 @@ func runCommand(command string, readStdout bool, arguments ...string) (int, stri // so check for emtpy stderr if command == "launchctl" { slurp, _ := ioutil.ReadAll(stderr) - if len(slurp) > 0 { + if len(slurp) > 0 && !bytes.HasSuffix(slurp, []byte("Operation now in progress\n")) { return 0, "", fmt.Errorf("%q failed with stderr: %s", command, slurp) } }