[root@aliyun-core opt]# ps -ef | grep master
root 23571 1 0 02:41 ? 00:00:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -p /etc/openresty/video_recom -c conf/nginx.conf
root 23590 1 0 02:41 ? 00:00:00 grep master
[root@aliyun-core opt]# ./ngx-sample-lua-bt -p 23571 --luajit20 -t 5
Cannot open /proc/23572/maps for reading: Permission denied
查看对应文件属主和权限如下:
[root@aliyun-core opt]# ls -l /proc/23572 | grep maps
ls: cannot read symbolic link /proc/23572/cwd: Permission denied
ls: cannot read symbolic link /proc/23572/root: Permission denied
ls: cannot read symbolic link /proc/23572/exe: Permission denied
-r--r--r-- 1 nobody nobody 0 Sep 30 02:42 maps
-r--r--r-- 1 nobody nobody 0 Sep 30 02:42 numa_maps
-r--r--r-- 1 nobody nobody 0 Sep 30 02:42 smaps
文件属主nobody,可读,但是读操作时却提示没有权限:
[root@aliyun-core opt]# cat /proc/23572/maps
cat: /proc/23572/maps: Permission denied
docker中当前用户为root,并且docker中的root/nobody用户和centos中的root/nobody id是相同的
[root@aliyun-core opt]# cat /etc/passwd | grep -E "^root"
root:x:0:0:root:/root:/bin/bash
[root@aliyun-core opt]# cat /etc/passwd | grep -E "^nobody"
nobody:x:99:99:Nobody:/:/sbin/nologin
###centos 用户id
chengxq@aliyun trunk$ cat /etc/passwd | grep -E "^root"
root:x:0:0:root:/root:/bin/bash
chengxq@aliyun trunk$ cat /etc/passwd | grep -E "^nobody"
nobody:x:99:99:Nobody:/:/sbin/nologin
chengxq@aliyun trunk$
直接部署在centos中的openresty+火焰图是可以正常运行的,但是部署到docker中之后就会出现此 Permission denied 问题,有认知道具体是什么原因吗?
[root@85-132-83-aliyun-core /]# stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
Pass 1: parsed user script and 470 library scripts using 126068virt/41064res/3312shr/37828data kb, in 370usr/30sys/392real ms.
WARNING: cannot find module nfs debuginfo: No DWARF information found [man warning::debuginfo]
WARNING: cannot find module sunrpc debuginfo: No DWARF information found [man warning::debuginfo]
WARNING: cannot find module nfs debuginfo: No DWARF information found [man warning::debuginfo]
Pass 2: analyzed script: 1 probe, 1 function, 7 embeds, 0 globals using 257340virt/173152res/6216shr/167000data kb, in 2160usr/350sys/2520real ms.
Pass 3: using cached /root/.systemtap/cache/7c/stap_7c0bb936c8056e80320a86692159019e_2696.c
Pass 4: using cached /root/.systemtap/cache/7c/stap_7c0bb936c8056e80320a86692159019e_2696.ko
Pass 5: starting run.
ERROR: module version mismatch (#1 SMP Tue Jul 4 13:29:22 UTC 2017 vs #1 SMP Tue Jul 4 15:04:05 UTC 2017), release 3.10.0-514.26.2.el7.x86_64
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run completed in 0usr/20sys/47real ms.
Pass 5: run failed. [man error::pass5]
[root@85-132-83-aliyun-core /]#
目前执行stap 命令报错:module version mismatch
docker 里的版本信息:
[root@85-132-83-aliyun-core /]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@85-132-83-aliyun-core /]# uname -r
3.10.0-514.26.2.el7.x86_64
[root@85-132-83-aliyun-core /]#
宿主机的版本信息:
[root@85-132-83-aliyun-core XX]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@85-132-83-aliyun-core XX]# uname -r
3.10.0-514.26.2.el7.x86_64
[root@85-132-83-aliyun-core XX]#
内核开发调试包也都是3.10.0-514.26.2.el7.x86_64对应的rpm,这个是哪里的问题
Hello!注意 docker run 加上 --priviledged --pid=host 选项以及把必要的目录映射进去,比如 /lib/modules/`uname -r`。
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
ERROR: Couldn't mount /sys/kernel/debug: Operation not permitted