Problem to track process IDs in HP-UX machine


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Problem to track process IDs in HP-UX machine
# 1  
Old 01-30-2008
Problem to track process IDs in HP-UX machine

Hello All,

I need to track the exact process ID related to a particular application running on HP-UX machine. i.e. the exact functionality of fuser unix command.
fuser application.log // It gives the exact process ID for application.log
Since there is no provision for 'fuser' in HP-UX machine, please help me how I can achieve the same functionality.

Thanks & Regards
Abhishek
# 2  
Old 01-30-2008
Quote:
Originally Posted by abhishek0071
Since there is no provision for 'fuser' in HP-UX machine, please help me how I can achieve the same functionality.
Hmmm...maybe this command?
# 3  
Old 01-31-2008
Thnx Perderabo for your quick response.
But the problem is I don't have permission for fuser command. That is why I am in problem. That is why while using /usr/sbin/fuser it is giving me error "Permission denied".
So what I want to do is to write a script using some command like ps -ef etc. and get the exact output as fuser produce.
For example : fuser application.log OUTPUT- 21235 (i.e. PID)
Similarly I want to perform this using ps command or set of commands. Is there any way to do it ?

Waiting for your response.......

Thanks & Regards
Abhishek
# 4  
Old 01-31-2008
No, ps does not have enough info. If lsof is installed on your system it may work for you. But lsof is not part of HP-UX and you cannot install it unless you are root.
# 5  
Old 01-31-2008
I know ps command is not enough as I have tried a lot. Also you can consider me as a user.
I am not a root and hence for fuser I don't have permission and searching for the alternatives.
Can you please suggest me any as this is really important !!

Thnx for your assistance
# 6  
Old 02-01-2008
I remember seing some issues due to a security patch...removing permissions on some commands...
So my point of vue is if you were not allowed to use fuser (I found a box like that...) the message would be: cannot execute:

ra:/opt/java/bin $ fuser -cu /opt
/usr/bin/ksh: fuser: cannot execute
ra:/opt/java/bin $ ll /usr/sbin/fuser
-r-xr--r-- 1 bin bin 24576 Aug 3 2000 /usr/sbin/fuser
ra:/opt/java/bin $ exit
ra:/opt/java/bin $ cd
ra:/home/vbe $ cp /usr/sbin/fuser .
ra:/home/vbe $ ll fuser
-r-xr--r-- 1 vbe bin 24576 Feb 1 15:32 fuser
ra:/home/vbe $ fuser -cu /opt
/opt: 3738mto(root) 3116mt(root) 3729mto(root) 3225mto(lp) 29018mcto(ratel) 3259mto(root) 3263mto(root) 3733mto(root) 3588mt(root) 3301mto(root) 3354mt(root) 3687co(nursery) 527mcto(omv) 3392mto(root) 3724mto(root) 3712mto(root) 3741mto(root) 4289mcto(omv) 3755mto(root) 4281mcto(omv) 27936c(ratel) 5320mto(root) 16447c(ratel) 7269mto(root) 4808mct(root) 5332mto(root) 5333mto(root) 1435mt(root) 29005c(ratel) 28971c(vbe) 14287c(vbe) 26547c(ratel) 28972c(vbe) 21845c(ratel) 14305mt(vbe) 1947co(nursery)

ra:/home/vbe $

So I wonder if it isnt more on the filesystem you have no rights...
# 7  
Old 02-02-2008
Thanks for your response vbe, but still the problem exists. On copying the executable file /usr/sbin/fuser to my home directory and then giving all permissions, it says
bash: fuser: command not found.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Some trace file to track timings of a process

I will initiate a process from Server1 and the flow is as follow Server1 --> Web server --> Application server --> DB Server Note all seperate unix servers. Now I need to put a trace for that process to track the timings from each server. Like the below trace should be there: ... (5 Replies)
Discussion started by: saraperu
5 Replies

2. Shell Programming and Scripting

List out Process ids restarted today

Hi, I need to list out the processes which are started/restarted today in my Solaris box. If not possible need to convert the process uptime in minutes or seconds and compare it with a configurable value to list out those process ids for further processing in my scripting. Can any one guide... (7 Replies)
Discussion started by: ananan
7 Replies

3. Shell Programming and Scripting

Search process ids

Hi, I have four tomcat instances named PNK, PNK1, PNK2, PNK3. All are running on the same server. To kill tomcat instance I usually do below for PNK1,PNK2,PNK3 kill -9 `ps -ef|grep tomcat|grep PNK1|grep -v grep|awk '{print $2}'` But the above command does not work for PNK. Can some... (7 Replies)
Discussion started by: lpprasad321
7 Replies

4. Shell Programming and Scripting

ps returning more process ids

Please help me with this question I have a tantan.sh under /home/mydir which is a caller to another script "tantan.sh" under /home/anotherdir ----------------------------------------------------------- /home/mydir/tantan.sh ------------------------------------------------------------... (6 Replies)
Discussion started by: guruincredible
6 Replies

5. Shell Programming and Scripting

Track Child process exit

hi, I have a job that spawns multiple child processes in background.. Catch is i want to wait for some jobs to finish before i spawn more background processes. (each job creates a file and deletes at the end of it . so i don't want start new jobs after x amount of disk size is used up) now,... (2 Replies)
Discussion started by: ak_saravanan
2 Replies

6. UNIX for Dummies Questions & Answers

Scripting - process and user ids...Help please

Hello all: Working on a job I was asked get a simple script to perform the following task and would like to ask for some help. I'm looking forward to learning more and diving deeper into the World of Open Source servers. I need a script for a Unix server, using as few lines as possible, that... (4 Replies)
Discussion started by: moahten
4 Replies

7. Shell Programming and Scripting

How to track and later kill a process in a script

Hello, I am trying to write a script that turns off the screensaver for a certain period of time, then come back on. I have had it up and running for a while, but then I decided to refactor it a bit for my family members that are less computer savvy. I am starting a subshell for the "meat" of... (4 Replies)
Discussion started by: Narnie
4 Replies

8. Shell Programming and Scripting

script to loop all process ids and take pmap

Hi all, I need a script that will loop around all the current processes and take a pmap -x <process id> and output each pmap to a separate file. Would anyone have a quick command to do this? (2 Replies)
Discussion started by: borderblaster
2 Replies

9. Shell Programming and Scripting

Track Sftp process

Hi, I am using sftp in my bash script. I wanted to know whether if there is any way that we can track whether sftp has been successful or not.. Does sftp return any codes? Thanks in adv (9 Replies)
Discussion started by: borncrazy
9 Replies

10. Programming

List of Thread IDs of a process

Hello, Can some one tell how to read the thread IDs of the current process in Sun Solaris. Any help will be appreciated. regards, Murali (0 Replies)
Discussion started by: hmurali
0 Replies
Login or Register to Ask a Question

Featured Tech Videos