@@ -18,12 +18,9 @@ package helper
1818
1919import (
2020 "fmt"
21- "github.com/codenotary/immudb/cmd/version"
22- "github.com/mitchellh/go-ps"
2321 "os"
2422 "os/exec"
2523 "path/filepath"
26- "strings"
2724 "time"
2825)
2926
@@ -45,7 +42,6 @@ func (e execs) Command(name string, arg ...string) *exec.Cmd {
4542
4643type Plauncher interface {
4744 Detached () error
48- Process (processName string ) (found bool , p ps.Process , err error )
4945}
5046
5147type plauncher struct {
@@ -66,10 +62,6 @@ func (pl plauncher) Detached() error {
6662 return err
6763 }
6864
69- if exists , p , _ := pl .Process (version .App ); exists {
70- return fmt .Errorf ("%s is already running. Pid %d" , version .App , p .Pid ())
71- }
72-
7365 for i , k := range os .Args {
7466 if k != "--" + DetachedFlag && k != "-" + DetachedShortFlag && i != 0 {
7567 args = append (args , k )
@@ -89,17 +81,3 @@ func (pl plauncher) Detached() error {
8981 Green , filepath .Base (executable ), Blue , cmd .Process .Pid , Reset )
9082 return nil
9183}
92-
93- //Process find a process with the given name
94- func (pl plauncher ) Process (processName string ) (found bool , p ps.Process , err error ) {
95- ps , err := ps .Processes ()
96- if err != nil {
97- return false , p , err
98- }
99- for _ , p1 := range ps {
100- if strings .Contains (p1 .Executable (), processName ) {
101- return true , p1 , nil
102- }
103- }
104- return false , nil , nil
105- }
0 commit comments