Operating System - HP-UX
1755601 Members
4264 Online
108836 Solutions
New Discussion юеВ

Giving a tag to a process !

 
Karunanidhi.S
Occasional Contributor

Giving a tag to a process !

Hi all!
Can anyone tell me how to tag a process and start it. Because, I am running several Java processes which I am not able to distinguish with ps command. So, I want some kind of identification to catch the process. Any inputs?

Thanks and Regards,
Karunanidhi.S
4 REPLIES 4
Paula J Frazer-Campbell
Honored Contributor

Re: Giving a tag to a process !

Hi
How about a different login for each?

Paula
If you can spell SysAdmin then you is one - anon
Kiran N. Mehta
Advisor

Re: Giving a tag to a process !

Hi:
You could write a wrapper start-up script that writes the pid and other pertinent info. to a disk-file for each invocation; an alias for the ps command could process that file further...
Alternatively, the -H option of ps (with UNIX95 set in its environment) could be of some help....
Cheers,
Kiran
RikTytgat
Honored Contributor

Re: Giving a tag to a process !

Hi,

You could make each process appear with a different string in the process table by using a wrapper that uses the execvp(3).

I have included such a wrapper in attachment: it is called execalias and offers the possibility to execute a proces and make it appear w/ a different name in the process table:

execalias -a "instance_1" -c "the_command"
execalias -a "instance_2" -c "the_command"

A ps -ef would show "instance_1" and "instance_2".


Hope this helps,
Rik
Kofi ARTHIABAH
Honored Contributor

Re: Giving a tag to a process !

You might want to look at this thread:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xd3fb5f260cafd4118fef0090279cd0f9!1,00.html

it describes how you could start the processes in the background and the and get/store the PIDs...
nothing wrong with me that a few lines of code cannot fix!