Repository: minio/minio (language: go)

Issue:
Systemd startup fails if MINIO_BROWSER disabled
## Expected Behavior

Minio should send systemd ready notification, regardless of MINIO_BROWSER setting. Otherwise systemd startup job timeouts.

## Current Behavior

Minio does not send ready notification, if MINIO_BROWSER is set `off`. Systemd startup job of type `notify` fails with timeout, since there is no notification.

## Possible Solution

Ready notification is not related to MINIO_BROWSER setting at all. Bug happens here: https://github.com/minio/minio/pull/17062/files#diff-62bf66f81379c08d5d498327bda47b7156fb55a6226f3df54e127c97cd4852a2R636


## Steps to Reproduce (for bugs)

1. Set env var `MINIO_BROWSER=off`
2. Start minio using systemd `systemctl start minio`
3. Systemd timeouts

## Regression

Yes, introduced by RELEASE.2023-05-04T21-44-30Z

## Your Environment

* Version used (`minio --version`): `minio version RELEASE.2023-05-04T21-44-30Z (commit-id=5569acd95cbc8c7d3fac59cf2aba77baa1b9bbeb)`
* Server setup and configuration: `MINIO_BROWSER=off`
* Operating System and version (`uname -a`): `Linux $hostname 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux`



Discussion / hints:

Fix patch:
diff --git a/cmd/server-main.go b/cmd/server-main.go
index e212e13e27d0e..c53c12a81edf0 100644
--- a/cmd/server-main.go
+++ b/cmd/server-main.go
@@ -664,10 +664,7 @@ func serverMain(ctx *cli.Context) {
 			setConsoleSrv(srv)
 
 			go func() {
-				server := newConsoleServerFn()
-				logger.FatalIf(server.Listen(), "Unable to initialize console server's sockets")
-				daemon.SdNotify(false, daemon.SdNotifyReady)
-				logger.FatalIf(server.Serve(), "Unable to initialize console server")
+				logger.FatalIf(newConsoleServerFn().Serve(), "Unable to initialize console server")
 			}()
 		}
 
@@ -790,6 +787,8 @@ func serverMain(ctx *cli.Context) {
 		logger.Info("======")
 	}
 
+	daemon.SdNotify(false, daemon.SdNotifyReady)
+
 	<-globalOSSignalCh
 }
 


Test patch: