39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
|
|
```
|
|||
|
|
根据进程号查看运行路径 (例子13129)
|
|||
|
|
[root@ict-dmp2-2859 puaiuc]# ll /proc/13129
|
|||
|
|
dr-xr-xr-x. 2 root root 0 1月 25 17:35 attr
|
|||
|
|
-rw-r--r--. 1 root root 0 1月 25 17:38 autogroup
|
|||
|
|
-r--------. 1 root root 0 1月 25 17:38 auxv
|
|||
|
|
-r--r--r--. 1 root root 0 1月 25 17:38 cgroup
|
|||
|
|
--w-------. 1 root root 0 1月 25 17:38 clear_refs
|
|||
|
|
-r--r--r--. 1 root root 0 11月 15 14:11 cmdline
|
|||
|
|
-rw-r--r--. 1 root root 0 1月 25 17:38 comm
|
|||
|
|
-rw-r--r--. 1 root root 0 1月 25 17:38 coredump_filter
|
|||
|
|
-r--r--r--. 1 root root 0 1月 25 17:38 cpuset
|
|||
|
|
lrwxrwxrwx. 1 root root 0 1月 25 17:38 cwd -> /usr/local/nginx
|
|||
|
|
-r--------. 1 root root 0 11月 15 14:11 environ
|
|||
|
|
lrwxrwxrwx. 1 root root 0 11月 15 14:11 exe -> /usr/local/nginx/sbin/nginx
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
容器查看
|
|||
|
|
```
|
|||
|
|
docker exec -it bash
|
|||
|
|
docker ps -a
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
shell 启动脚本 启停
|
|||
|
|
```
|
|||
|
|
pid=`ps -ef|grep xxxxxxxxx|grep -v grep|awk '{print $2}'`
|
|||
|
|
echo $pid
|
|||
|
|
kill -9 $pid
|
|||
|
|
./xxxx >> log.mock 2>&1&
|
|||
|
|
echo '-------'
|
|||
|
|
pid=`ps -ef|grep xxxxxxxxx|grep -v grep|awk '{print $2}'`
|
|||
|
|
echo $pid
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 问题排查 进程 cpu 内存 占用
|
|||
|
|
```
|
|||
|
|
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
|
|||
|
|
```
|