mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 02:48:59 +00:00
Find syncthing binary in $PATH when restarting (fixes #68)
This commit is contained in:
parent
f3a793ce91
commit
725f748b17
8
main.go
8
main.go
@ -10,6 +10,7 @@ import (
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
@ -279,7 +280,12 @@ func restart() {
|
||||
if doAppend {
|
||||
args = append(args, "-delay", "2")
|
||||
}
|
||||
proc, err := os.StartProcess(os.Args[0], args, &os.ProcAttr{
|
||||
pgm, err := exec.LookPath(os.Args[0])
|
||||
if err != nil {
|
||||
warnln(err)
|
||||
return
|
||||
}
|
||||
proc, err := os.StartProcess(pgm, args, &os.ProcAttr{
|
||||
Env: os.Environ(),
|
||||
Files: []*os.File{os.Stdin, os.Stdout, os.Stderr},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user