I have several Nginx installs on my server and now i cannot seem to figure out where the currently running Nginx is running from..
I have the PID which is: 12530
Can i use that to find out where Nginx is running from?
Or is there any other way?
I have several Nginx installs on my server and now i cannot seem to figure out where the currently running Nginx is running from..
I have the PID which is: 12530
Can i use that to find out where Nginx is running from?
Or is there any other way?
EDIT: wait, you've got a PID, it's not as difficult as the-below. Just look at the output of:
$ sudo ls -l /proc/12530/exe
If by "where Nginx is running from" you mean "which particular binary", you can use something like the following:
$ sudo lsof | grep nginx | grep txt
nginx 8100 root txt REG 202,1 7645520 1931225 /usr/sbin/nginx
...
..which tells me that the version at /usr/sbin/nginx
is running.
You might need to apt-get install lsof
.
Take a look in /proc/<PID>/
. It contains lots of information about the process and is documented in proc(5). The file exe
will be a symlink to the executable. I.e:
$ ls -l /proc/11806/exe
lrwxrwxrwx 1 u u 0 Feb 7 13:15 /proc/11806/exe -> /usr/bin/emacs23-x
PID 11806 is running the emacs23-x executable.