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
# 8  
Old 02-04-2008
export PATH=$PATH:$HOME:. (or the correct syntax for bash, I cant think of it at the moment (Alzeimer already?...))

Then try...
# 9  
Old 02-04-2008
I am just confirming, please have a look into the steps I have written(as per the information given by you):

1) export PATH=/usr/local/bin/bash (syntax for bash)
2) /opt/java/bin $ fuser -cu /opt
3) user:/opt/java/bin $ ll /usr/sbin/fuser
-r-xr--r-- 1 bin bin 24576 Aug 3 2000 /usr/sbin/fuser
4) user:/opt/java/bin $ exit
5) user:/opt/java/bin $ cd
6) user:/home/userID $ cp /usr/sbin/fuser .
7) user:/home/userID $ ll fuser
-r-xr--r-- 1 userID bin 24576 Feb 1 15:32 fuser
8) user:/home/userID $ fuser -cu /opt

Please correct me if I am wrong.
# 10  
Old 02-04-2008
Thanks a lot for your help.
I tried the one you have suggested and written a script for the set of commands.
It's working . Cool
Once again thanks a lot VBE, you have made my day
# 11  
Old 02-05-2008
Hello vbe,

One last question for you :

in my script I have written
export PATH=$PATH:$HOME:/usr/local/bin/bash
cd /opt/java1.3/jre/bin
fuser $1

The script is working fine but from where it calls fuser command. Is it calling from /usr/sbin/ folder. If yes then why doesn't it get executed directly ?
Please suggest me how fuser works here ??
# 12  
Old 02-05-2008
>export PATH=$PATH:$HOME:/usr/local/bin/bash

Here what puzzles me is /usr/local/bin/bash which has nothing to do in your path

I put in my previous reply a dot (.) at the end of the variable, for
1) security reasons
2) you may (dont laught it happened to a developper last week!) have a program in your $HOME with the name of a command or "official" program...

>Please suggest me how fuser works here ??
Look this display:
rat:/home/vbe $ which fuser
./fuser
rat:/home/vbe $ ll /usr/sbin/fuser
-r-xr--r-- 1 bin bin 24576 Aug 3 2000 /usr/sbin/fuser
rat:/home/vbe $
rat:/home/vbe $ cd /usr
rat:/usr $ which fuser
no fuser in /usr/bin /opt/ansic/bin /usr/ccs/bin /usr/contrib/bin /opt/nettladm/bin /opt/fc/bin /opt/fcms/bin /opt/upgrade/bin /opt/pd/bin /usr/dt/bin /usr/bin/X11 /usr/contrib/bin/X11 /opt/resmon/bin /opt/pred/bin /opt/hparray/bin /opt/ignite/bin /opt/langtools/bin /opt/imake/bin /opt/samba/bin /opt/tusc/bin /opt/hpnp//bin /opt/gcc/bin /opt/perf/bin /opt/prm/bin /opt/cobol/bin /opt/OV/bin/OpC /opt/graphics/common/bin /usr/sbin/diag/contrib /usr/sbin /sbin /usr/local/bin .

So for executables the system looks through you $PATH, since the "official" fuser is not executable for you it does not see it and continues its search... and finds the one in your home directory or wherever you put it (if you updated your PATH correctly...)

All the best
# 13  
Old 02-05-2008
Thanks a lot man !!
I have changed my script as per your suggestions and Now I got it.
# 14  
Old 02-06-2008
Youre welcome!

All the best
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