cmd/syncthing: Don't open browser on upgrade restarts (fixes #6437) (#6442)

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:
Jakob Borg 2020-03-22 11:39:09 +01:00 committed by GitHub
parent e2f3500df9
commit 1ea98a16b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -311,6 +311,11 @@ func copyStdout(stdout io.Reader, dst io.Writer) {
}
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" {
// syscall.Exec is the cleanest way to restart on Unixes as it
// replaces the current process with the new one, keeping the pid and