summaryrefslogtreecommitdiffstats
path: root/lib/syncthing/st.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-07 23:03:52 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-09 10:03:06 +0200
commit90992bcc039d2b982ad6df18cf3188b53f939368 (patch)
tree45d471124064e58e7bcc8c6aeca1355d558abd09 /lib/syncthing/st.go
parentd917dcca04b8d5f5a7a4fdf82d0a66ef14611fca (diff)
Kill right Syncthing (same url) in DEBUG_MODE
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/syncthing/st.go')
-rw-r--r--lib/syncthing/st.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index bc3b101..304cfca 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -131,7 +131,8 @@ func (s *SyncThing) startProc(exeName string, args []string, env []string, eChan
// Kill existing process (useful for debug ;-) )
if os.Getenv("DEBUG_MODE") != "" {
- exec.Command("bash", "-c", "pkill -9 "+exeName).Output()
+ fmt.Printf("\n!!! DEBUG_MODE set: KILL existing %s process(es) !!!\n", exeName)
+ exec.Command("bash", "-c", "ps -ax |grep "+exeName+" |grep "+s.BaseURL+" |cut -d' ' -f 1|xargs -I{} kill -9 {}").Output()
}
// When not set (or set to '.') set bin to path of xds-agent executable