mirror of
https://github.com/minio/minio.git
synced 2025-12-07 16:22:33 -05:00
Add support for customizable user (#7569)
This commit is contained in:
committed by
Nitish Tiwari
parent
1008c2c069
commit
91ceae23d0
@@ -1,3 +1,5 @@
|
||||
// +build ignore
|
||||
|
||||
/*
|
||||
* MinIO Cloud Storage, (C) 2019 MinIO, Inc.
|
||||
*
|
||||
@@ -36,7 +38,7 @@ const (
|
||||
initGraceTime = 300
|
||||
healthPath = "/minio/health/live"
|
||||
timeout = time.Duration(30 * time.Second)
|
||||
minioProcess = "minio"
|
||||
tcp = "tcp"
|
||||
)
|
||||
|
||||
// returns container boot time by finding
|
||||
@@ -66,9 +68,16 @@ func findEndpoint() (string, error) {
|
||||
// split netstat output in rows
|
||||
scanner := bufio.NewScanner(stdout)
|
||||
scanner.Split(bufio.ScanLines)
|
||||
// loop over the rows to find MinIO process
|
||||
// MinIO works on TCP and it is supposed to be
|
||||
// the only process listening on a port inside
|
||||
// container. So we take the first row of netstat
|
||||
// output (that has tcp) and assume that is the
|
||||
// MinIO server port.
|
||||
// Since MinIO is running as non-root user, we can
|
||||
// no longer depend on the PID/Program name column
|
||||
// of netstat output
|
||||
for scanner.Scan() {
|
||||
if strings.Contains(scanner.Text(), minioProcess) {
|
||||
if strings.Contains(scanner.Text(), tcp) {
|
||||
line := scanner.Text()
|
||||
newLine := strings.Replace(line, ":::", "127.0.0.1:", 1)
|
||||
fields := strings.Fields(newLine)
|
||||
|
||||
Reference in New Issue
Block a user