Skip to content

Commit

Permalink
update unix.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Thompson committed Dec 30, 2023
1 parent 5d3940a commit 60e4c4e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kit/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package kit

import (
"fmt"
"io"
"os/exec"
"syscall"
Expand Down Expand Up @@ -34,7 +35,7 @@ func Spawn(executable string, background bool, stdout io.Writer, stderr io.Write
LogIfError(err)
return err
}
Info("Spawn", "bg", background, "cmd")
LogInfo("Spawn", "bg", background, "cmd")
return nil
}

Expand All @@ -47,11 +48,18 @@ func StartDeviceInput() {

// KillProcess kills a process (synchronously)
func KillExecutable(exe string) {
Warn("KillProcess in unix.go not tested", "exe", exe)
LogWarn("KillProcess in unix.go not tested", "exe", exe)
Spawn("pkill", false, noWriter, noWriter, exe)
}

func IsRunningExecutable(exe string) (bool,error) {
err := fmt.Eprintf("unix.go: IsRunningExecutable needs work")
err := fmt.Errorf("unix.go: IsRunningExecutable needs work")
return false,err
}

func StartExecutableLogOutput(logName string, fullexe string, args ...string) error {
err := fmt.Errorf("unix.go: StartExecutableLogOutput needs work")
// logWriter := NewExecutableLogWriter(logName)
// _, err := StartExecutableInBackground(fullexe, logWriter, logWriter, args...)
return err
}

0 comments on commit 60e4c4e

Please sign in to comment.