Repository: minio/minio (language: go)

Issue:
Service Restart for Windows instance not working cause Syscall.Exec not supported
## Expected Behavior
minio on Windows shoud be restarted by `mc admin service restart minio` command. 

## Current Behavior
```
Time: 15:39:30 UTC 01/30/2023
DeploymentID: 0180cccd-a784-418b-8abe-6a43f530f843
Error: not supported by windows (syscall.Errno)
       2: internal\logger\logger.go:258:logger.LogIf()
       1: cmd\signals.go:90:cmd.handleSignals()
```
Related issues: https://github.com/golang/go/issues/30662

## Possible Solution
Maybe use some functions in `os/exec` on Windows to restart service.

## Steps to Reproduce (for bugs)
1. `F:\minio.exe server F:\Data` with env vars of user/pass
2. `./mc config host add minio http://127.0.0.1:9000`
3. `./mc admin service restart minio`
4. minio server exited without restart

## Context
Nothing

## Regression
No

## Your Environment
- Windows 10
- minio RELEASE.2023-01-25T00-19-54Z (go1.19.4 windows/amd64)


Discussion / hints:

Fix patch:
diff --git a/cmd/service.go b/cmd/service.go
index e29526195a928..b5ffc5f8b716b 100644
--- a/cmd/service.go
+++ b/cmd/service.go
@@ -21,6 +21,7 @@ import (
 	"context"
 	"os"
 	"os/exec"
+	"runtime"
 	"syscall"
 )
 
@@ -56,6 +57,19 @@ func initGlobalContext() {
 // deployed binary to be started. It returns the pid of the newly started
 // process when successful.
 func restartProcess() error {
+	if runtime.GOOS == globalWindowsOSName {
+		cmd := exec.Command(os.Args[0], os.Args[1:]...)
+		cmd.Stdout = os.Stdout
+		cmd.Stderr = os.Stderr
+		cmd.Stdin = os.Stdin
+		cmd.Env = os.Environ()
+		err := cmd.Run()
+		if err == nil {
+			os.Exit(0)
+		}
+		return err
+	}
+
 	// Use the original binary location. This works with symlinks such that if
 	// the file it points to has been changed we will use the updated symlink.
 	argv0, err := exec.LookPath(os.Args[0])


Test patch: