Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions cmd/mod_prometheus_status/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ func startMetricServer(startChannel chan bool, socketPath string, userID, groupI
return
}
defer l.Close()
err = os.Chown(socketPath, userID, groupID)
if err != nil {
logErrorf("cannot chown metricssocket: %s", err.Error())
startChannel <- false
return
if os.Geteuid() == 0 {
err = os.Chown(socketPath, userID, groupID)
if err != nil {
logErrorf("cannot chown metricssocket: %s", err.Error())
startChannel <- false
return
}
}

logDebugf("listening on metricsSocket: %s", socketPath)
Expand Down
Loading