|
|
@ -28,7 +28,7 @@ func LaunchProcess(proc *config.Process) { |
|
|
|
proc.ExecCmd.Err = nil |
|
|
|
proc.ExecCmd.Err = nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println("STARTING", proc.Name) |
|
|
|
fmt.Println("STARTING", proc.URL) |
|
|
|
|
|
|
|
|
|
|
|
stderr, err := proc.ExecCmd.StderrPipe(); |
|
|
|
stderr, err := proc.ExecCmd.StderrPipe(); |
|
|
|
LaunchLogger(stderr, os.Stdout, err) |
|
|
|
LaunchLogger(stderr, os.Stdout, err) |
|
|
@ -37,12 +37,12 @@ func LaunchProcess(proc *config.Process) { |
|
|
|
LaunchLogger(stdout, os.Stdout, err) |
|
|
|
LaunchLogger(stdout, os.Stdout, err) |
|
|
|
|
|
|
|
|
|
|
|
proc.ExecCmd.Start() |
|
|
|
proc.ExecCmd.Start() |
|
|
|
fmt.Println("WAITING for", proc.Name) |
|
|
|
fmt.Println("WAITING for", proc.URL) |
|
|
|
|
|
|
|
|
|
|
|
fmt.Println("SENDING READY on channel") |
|
|
|
fmt.Println("SENDING READY on channel") |
|
|
|
proc.Ready<- "ready" |
|
|
|
proc.Ready<- "ready" |
|
|
|
proc.ExecCmd.Wait() |
|
|
|
proc.ExecCmd.Wait() |
|
|
|
fmt.Println("PROCESS", proc.Name, "EXITED") |
|
|
|
fmt.Println("PROCESS", proc.URL, "EXITED") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -58,7 +58,7 @@ func main() { |
|
|
|
proc.Ready = make(chan string) |
|
|
|
proc.Ready = make(chan string) |
|
|
|
go LaunchProcess(&proc) |
|
|
|
go LaunchProcess(&proc) |
|
|
|
|
|
|
|
|
|
|
|
http.HandleFunc(proc.Name, func(w http.ResponseWriter, r *http.Request) { |
|
|
|
http.HandleFunc(proc.URL, func(w http.ResponseWriter, r *http.Request) { |
|
|
|
<-proc.Ready |
|
|
|
<-proc.Ready |
|
|
|
fmt.Println("!!!!!!!!!!!!!!!!!!! TIME TO DIE!!!!!") |
|
|
|
fmt.Println("!!!!!!!!!!!!!!!!!!! TIME TO DIE!!!!!") |
|
|
|
err := proc.ExecCmd.Process.Kill() |
|
|
|
err := proc.ExecCmd.Process.Kill() |
|
|
|