diff options
author | Andrei Belov <defan@nginx.com> | 2020-11-19 21:19:57 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2020-11-19 21:19:57 +0300 |
commit | 7f9079a3cd4cdb6ac3fea53f10bd34fe8b82fe9c (patch) | |
tree | c79dc48a3260156f3f824ecd299e5a4934d749c5 /test/go/ns_inspect | |
parent | 646d047e5d12515ceac02279b373601ce0752982 (diff) | |
parent | 806a9b2515c60b12a68cd97af04f7fa5cb4dffed (diff) | |
download | unit-7f9079a3cd4cdb6ac3fea53f10bd34fe8b82fe9c.tar.gz unit-7f9079a3cd4cdb6ac3fea53f10bd34fe8b82fe9c.tar.bz2 |
Merged with the default branch.1.21.0-1
Diffstat (limited to 'test/go/ns_inspect')
-rw-r--r-- | test/go/ns_inspect/app.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/go/ns_inspect/app.go b/test/go/ns_inspect/app.go index 4d19a796..570580e6 100644 --- a/test/go/ns_inspect/app.go +++ b/test/go/ns_inspect/app.go @@ -7,6 +7,7 @@ import ( "unit.nginx.org/go" "os" "strconv" + "io/ioutil" ) type ( @@ -26,6 +27,7 @@ type ( GID int NS NS FileExists bool + Mounts string } ) @@ -77,6 +79,11 @@ func handler(w http.ResponseWriter, r *http.Request) { out.FileExists = err == nil } + if mounts := r.Form.Get("mounts"); mounts != "" { + data, _ := ioutil.ReadFile("/proc/self/mountinfo") + out.Mounts = string(data) + } + data, err := json.Marshal(out) if err != nil { w.WriteHeader(http.StatusInternalServerError) |