- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get full path of a process listed on ps out...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2015 08:48 AM
тАО09-17-2015 08:48 AM
How to get full path of a process listed on ps output
Hi, I need to know the full path of a process I see on the ps output / top output :
$ ps -ef | grep event_demon
autosys 25876 1 0 Jun 2 ? 3419:44 event_demon -A PPE -R
autosys 3092 1 0 Jun 5 ? 3228:04 event_demon -A PQE -R
gzdz51 16813 14788 0 10:46:20 pts/3 0:00 grep event_demon
$ uname
HP-UX
$ uname -a
HP-UX uspls005 B.11.31 U ia64 1164653830 unlimited-user license
$
I cannot determine what started those event_demon, maybe knowing its location will help me. Does anybody know if that is possible to get?
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2015 11:06 AM
тАО09-17-2015 11:06 AM
Re: How to get full path of a process listed on ps output
Since parent PID is 1 it is most likely started by init.
But maybe "whence" or "whereis" can help you.
Google points to ca autosys product.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2015 10:55 PM
тАО09-17-2015 10:55 PM
Re: How to get full path of a process listed on ps output
lsof(1m) may provide this info given the PID?
Otherwise you can get out your trusty "find(1) -name event_demon" and scan files systems. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2015 12:15 AM
тАО09-18-2015 12:15 AM
Re: How to get full path of a process listed on ps output
Have you tried pstat_getcommandline() ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2015 01:25 AM
тАО09-18-2015 01:25 AM
Re: How to get full path of a process listed on ps output
@Santosh Abraham wrote:Have you tried pstat_getcommandline() ?
Sorry - ignore the above. I did not grok your question correctly. If you have super-user access and are inclined to a bit of programming perhaps the following might work:-
-------------------------------<snip>----------------------
char filename[PATH_MAX+1];
struct pst_status ps;
if (pstat_getproc(&ps,sizeof(ps),0,pid_of_prog_u_r_interested_in)) == -1) {
perror("pstat_getproc");
return -1;
}
if (pstat_getpathname(filename,sizeof(filename),&ps.pst_fid_text) == -1) {
perror("pstat_getpathname");
return -1;
}
--------------------------<snip>----------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2015 03:16 AM - edited тАО09-18-2015 03:19 AM
тАО09-18-2015 03:16 AM - edited тАО09-18-2015 03:19 AM
Re: How to get full path of a process listed on ps output
There is no substitute for pstree.
pstree -p <any_PID>
will show you the entire top-to-bottom parent-child relationship.
Just give it *any* PID and the entire tree will be shown.
# pstree -p 17186 -+- 00001 root init \-+- 01894 root /usr/local/sbin/sshd \-+- 16910 root sshd: root@pts/0 \-+- 16912 root -sh \-+- 17186 root /usr/bin/ksh cfg2html -o /tmp \-+- 18130 root /usr/bin/ksh cfg2html -o /tmp \-+- 18133 root fold -w160 |--- 18137 root expand \-+- 18134 root /usr/bin/ksh cfg2html -o /tmp \-+- 18135 root /usr/bin/sh /opt/hpsmh/bin/smhassist \-+- 18138 root /opt/perl/bin/perl /opt/hpsmh/bin/smhassist.pl \--- 18140 root /usr/sbin/swverify -x autoselect_dependencies..
Here are all the options:
pstree $Revision: 2.33 $ by Fred Hucht (C) 1993-2007 EMail: fred AT thp.Uni-Duisburg.de Usage: pstree [-f file] [-g n] [-u user] [-U] [-s string] [-p pid] [-w] [pid ...] -f file read input from <file> (- is stdin) instead of running "ps -ef" -g n use graphics chars for tree. n=1: IBM-850, n=2: VT100, n=3: UTF-8 -l n print tree to n level deep -u user show only branches containing processes of <user> -U don't show branches containing only root processes -s string show only branches containing process with <string> in commandline -p pid show only branches containing process <pid> -w wide output, not truncated to window width pid ... process ids to start from, default is 1 (init) use 0 to also show kernel processes
It is mandatory for my toolbox, just like lsof and tusc.
Get a copy here: ftp://ftp.sourcedirect.com/pub/tools/pstree/
Bill Hassell, sysadmin