mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
We set the STRESTART environment when starting the inner process after the first time, but this didn't persist when restarting the monitor process. Now it does.
This commit is contained in:
parent
e2f3500df9
commit
1ea98a16b1
@ -311,6 +311,11 @@ func copyStdout(stdout io.Reader, dst io.Writer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func restartMonitor(args []string) error {
|
func restartMonitor(args []string) error {
|
||||||
|
// Set the STRESTART environment variable to indicate to the next
|
||||||
|
// process that this is a restart and not initial start. This prevents
|
||||||
|
// opening the browser on startup.
|
||||||
|
os.Setenv("STRESTART", "yes")
|
||||||
|
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
// syscall.Exec is the cleanest way to restart on Unixes as it
|
// syscall.Exec is the cleanest way to restart on Unixes as it
|
||||||
// replaces the current process with the new one, keeping the pid and
|
// replaces the current process with the new one, keeping the pid and
|
||||||
|
Loading…
Reference in New Issue
Block a user