Find path of executable having problem


 
Thread Tools Search this Thread
Operating Systems Solaris Find path of executable having problem
# 1  
Old 07-10-2013
Wrench Find path of executable having problem

Hi

cannot find the path to a running process on a host.
I looked and tried some suggestions in forums to no avail.
can someone please help? I need to know where this process is starting from as we have several versions in multiple directories

--------- Process name
Code:
1201 1 0 Feb 14 ? 17151:37 ./pis2

--------- I'm running
Code:
uname -a
SunOS 5.10 Generic_141444-09 sun4v sparc SUNW,SPARC-Enterprise-T5120

----------- PS command options
Code:
ps [ -aAdeflcjLPyZ ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ] [ -z zonelist ]

------------------- content of /proc directory for the proccess

Code:
-r-------- 1 radmin tis 10184 Feb 14 2011 xmap
-r-------- 1 radmin tis 0 Feb 14 2011 watch
-r--r--r-- 1 radmin tis 256 Feb 14 2011 usage
-r-------- 1 radmin tis 1232 Feb 14 2011 status
-r-------- 1 radmin tis 1536 Feb 14 2011 sigact
lr-x------ 1 radmin tis 0 Feb 14 2011 root ->
-r-------- 1 radmin tis 6432 Feb 14 2011 rmap
-r--r--r-- 1 radmin tis 336 Feb 14 2011 psinfo
-r-------- 1 radmin tis 72 Feb 14 2011 priv
dr-x------ 2 radmin tis 9520 Feb 14 2011 path
-r-------- 1 radmin tis 119328 Feb 14 2011 pagedata
dr-x------ 2 radmin tis 1312 Feb 14 2011 object
dr-xr-xr-x 8 radmin tis 128 Feb 14 2011 lwp
-r--r--r-- 1 radmin tis 1856 Feb 14 2011 lusage
-r-------- 1 radmin tis 5432 Feb 14 2011 lstatus
-r--r--r-- 1 radmin tis 680 Feb 14 2011 lpsinfo
dr-x------ 2 radmin tis 8208 Feb 14 2011 fd
lr-x------ 1 radmin tis 0 Feb 14 2011 cwd ->
--w------- 1 radmin tis 0 Feb 14 2011 ctl
-r-------- 1 radmin tis 36 Feb 14 2011 cred
dr-x------ 2 radmin tis 32 Feb 14 2011 contracts
-r-------- 1 radmin tis 152 Feb 14 2011 auxv
-rw------- 1 radmin tis 922820608 Feb 14 2011 as
dr-x--x--x 5 radmin tis 832 Feb 14 2011 .
-r-------- 1 radmin tis 6432 Feb 9 2012 map


Last edited by Scrutinizer; 07-10-2013 at 05:48 PM.. Reason: code tags
# 2  
Old 07-10-2013
Try:
Code:
pwdx 1201

# 3  
Old 07-10-2013
your ./pis2 process is running under PID 1 with a PPID 0 which is quiet interesting ... i would suggest running lsof on the PID but that will not be accurate with that PID 1 (see man lsof) ... try running the lsof on the different versions of the file ... also check if any of them execs to run in the background ...

also check the svcsadm for services that you are not familiar with ... if still an issue, reboot the server when you have the time and see if the process still comes up ...
# 4  
Old 07-10-2013
More generally 'lsof' tells you every file open in every process, including sockets and their connections.
# 5  
Old 07-10-2013
However, lsof is usually not available on Solaris machines. There are hopefully ways to get the information lsof provides with standard Solaris tools.

To get the full path of the command run you can use this simple command:
Code:
ls -l /proc/<pid>/path/a.out

# 6  
Old 07-10-2013
Hi all - Lsof not available - will try other comands

Hi - Thanks for ur replies

Just Ice & DGPickett>>
lsof was the first command I tried , but it is not available on this install. So no go there

---------------------------

jlliagre >> I will try your command s -l /proc/<pid>/path/a.out I tried to run other similar command but
could not see content just garble data. But I try it tomorrow as I'm not at work at this moment

-----------------------
bartus11 >> pwdx - Ok I will try it if it is available on the solaris

I usually had no problem finding this info on redhat with lsof or from proc directory ,, I tried bunch of other code I found online but no dice ..

I hope to have better luck the two commands suggested here .. I will report back
# 7  
Old 07-10-2013
pwdx is definitely a standard Solaris command and shows the current directory of a process. This is enough to answer your question given the relative PATH used to run your command.

The solution I suggested is more general and hopefully doesn't output garbled data.
This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find exit with success with non executable directory

Hi there, I'm quite surprised by the following behavior of find. $ find -ls # I have a directory and a file in it 8145 4 drwxr-xr-x 3 me me 4096 May 10 09:36 . 87 4 drwxr-xr-x 2 me me 4096 May 10 09:36 ./dir 88 0 -rw-r--r-- 1 me me 0... (2 Replies)
Discussion started by: chebarbudo
2 Replies

2. Solaris

Finding the path to an executable , installed package

Hi all, Recently i wanted to see if i have openssl installed in my system (solaris 10), so i do this (not sure if this is the right way to do this) pkginfo -i | grep -i "ssl" system SUNWopenssl-commands OpenSSL Commands (Usr) system SUNWopenssl-include ... (3 Replies)
Discussion started by: javanoob
3 Replies

3. UNIX for Dummies Questions & Answers

Problem running executable with ./

Hey all, I'm trying to execute a program and despite it appearing to be there, I keep getting this: -bash: ./aisdispatcher: No such file or directoryTo run it, I'm going into the directory where it is stored and running ./aisdispatcher...the result of which should just be a listing of options... (10 Replies)
Discussion started by: pmd006
10 Replies

4. Shell Programming and Scripting

Question on tweaking the PATH variable to allow the world to run my executable script

All, I am pretty new to Unix and still in the learning curve :) I have a simple requirement for which I did not get an answer yet (Atleast I do not know how to keyword the search for my requirement!!!). I have an executable script my.script1 in a folder /data/misc/scripts/dev, which when... (5 Replies)
Discussion started by: bharath.gct
5 Replies

5. Shell Programming and Scripting

Problem with embedded FTP command in Ksh - System Cannot find the specified path.

I have the following FTP embedded in a Ksh script on AIX 5.3 ftp -n <<WHATEVER open 10.101.26.218 user hcistats ******* ascii put $thupdatefile put $thcollectfile quit WHATEVER Here is what my script returns: ... (3 Replies)
Discussion started by: troym72
3 Replies

6. Shell Programming and Scripting

problem in making Awk executable script

Guys I placed #!path/awk -f placed awk script and used $1 to call 1st inputfile inside the script. But some where I did mistake. Could you please help me run this script as executable I forgot to mention I also used BEGIN before placing awk script. But nothing worked out. Script ... (2 Replies)
Discussion started by: repinementer
2 Replies

7. Programming

gdb: problem while debug an executable file

I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error -- please tell me the solutions?? Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies

8. Shell Programming and Scripting

script to find latest executable in particular directory and start that particular ex

i have a directory in which there are executable files and these files are added at runtime. now i need a shell script which will be called at a certain interval. this shell script should find the latest executable file in that directory and start that executable. care should be taken that once the... (6 Replies)
Discussion started by: kvineeth
6 Replies

9. UNIX for Dummies Questions & Answers

cc path problem - no acceptable path found

Hello everyone, I'm a unix noob. I have a powerbook running mac os x 10.4 and for one of my classes I need to install the latest version of php (5.0.5). I'm following the instructions at http://developer.apple.com/internet/opensource/php.html to install but I've run into a problem. The... (2 Replies)
Discussion started by: kendokendokendo
2 Replies

10. UNIX for Advanced & Expert Users

process executable file full path

hi guys i give "ps -ef | grep some_executable_file" on the command line. this "some_executable_file" resides on many paths which r included in the PATH environment variable, so the output depicts only "some_executable_file" in the COMMAND column. how can i get the full path? thanx (3 Replies)
Discussion started by: xtrix
3 Replies
Login or Register to Ask a Question