How does Linux see where the process is running?
This article mainly explains "how to check the location of the process running by Linux". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how Linux can see where the process is running".
Linux to see where the process is running 1. Check the pid of the running process through the ps or top command
Ps-aux | grep php-fpm # or top\ 2. After getting the pid of the process, use the command ls-l / proc/$ {pid}, which lists the startup location of the process.
Ll / proc/22551
Total 0 dr-xr-xr-x 2 www www 0 Jul 5 11:15 attr-rw-r--r-- 1 www www 0 Jul 5 11:49 autogroup-r-1 www www 0 Jul 5 11:49 auxv-Rukhoku Rakoto-1 www www 0 Jul 5 11:49 cgroup-W-1 www www 0 Jul 5 11:49 clear_refs-RMuk Mustang Rafael-1 www www 0 Jul 5 06:53 cmdline -rw-r--r-- 1 www www 0 Jul 5 11:49 coredump_filter-Rafael Rafael-1 www www 0 Jul 5 11:49 cpuset lrwxrwxrwx 1 www www 0 Jul 5 11:49 cwd-> / apps/php/lib/php/extensions/no-debug-zts-20151012-r-1 www www 0 Jul 5 11:49 environ lrwxrwxrwx 1 www www 0 Jul 5 07:39 exe-> / apps/php/sbin/php-fpm dr-x-- -2 www www 0 Jul 5 11:15 fd dr-x- 2 www www 0 Jul 5 11:49 fdinfo-r-1 www www 0 Jul 5 11:49 io-rw- 1 www www 0 Jul 5 11:49 limits-rw-r--r-- 1 www www 0 Jul 5 11:49 loginuid-Ruki Ruki-1 www www 0 Jul 5 11:49 maps-rw- 1 www www 0 Jul 5 11:49 mem-Rkashi-1 www www 0 Jul 5 11:49 mountinfo-RQM RQM-1 www www 0 Jul 5 11:49 mounts-r-1 www www 0 Jul 5 11:49 mountstats dr-xr-xr-x 6 www www 0 Jul 5 11:49 net-RKuk RQ-1 www www 0 Jul 5 11:49 numa_maps-rw-r--r-- 1 www Www 0 Jul 5 11:49 oom_adj-Rafael-1 www www 0 Jul 5 11:49 oom_score-rw-r--r-- 1 www www 0 Jul 5 11:49 oom_score_adj-rkashi-1 www www 0 Jul 5 11:49 pagemap-Rafael-1 www www 0 Jul 5 11:49 personality lrwxrwxrwx 1 www www 0 Jul 5 11:49 root-> /-rw-r--r-- 1 Www www 0 Jul 5 11:49 sched-Rafael-1 www www 0 Jul 5 11:49 schedstat-RQM RQA-1 www www 0 Jul 5 11:49 sessionid-Rafael Rafael-1 www www 0 Jul 5 11:49 smaps-Rafael-Rafael-1 www www 0 Jul 5 11:49 stack-Rafael Rafael-1 www www 0 Jul 5 06:40 stat-Rafael-1 Www www 0 Jul 5 08:48 statm-r Muq-1 www www 0 Jul 5 06:53 status-r QQ-r QQ-1 www www 0 Jul 5 11:49 syscall dr-xr-xr-x 3 www www 0 Jul 5 11:49 task-r Muq-1 www www 0 Jul 5 11:49 wchan here I believe that you have a deeper understanding of "how to see where the process is running in Linux", so you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!