Wron process name in ps(1) output ? (117 Views)
Reply
Occasional Advisor
José L. Marcos
Posts: 17
Registered: ‎10-22-1996
Message 1 of 4 (117 Views)

Wron process name in ps(1) output ?

Hi *,

Could someone give me some ideas on the differences we noticed on ps -ef command for HP-UX 11.0 and HP-UX 11i systems.

On 11.0, the process name for shell scripts is correct, on 11i, the process name is "prefixed" with the Shell command.

Let me try to be more clear : the shell script is nothing more than:
#!/usr/bin/ksh
sleep 50

I run it in bckground as './dumb.ksh &', then a ps -ef command gives me :

on 11.0:
marcos 123 122 0 16:00:12 pts/1 0:00 ./dumb.ksh

on 11i:
marcos 123 122 0 16:00:12 pts/1 0:00 /usr/bin/ksh ./dumb.ksh

What can explain this difference on process name (COMMAND column of ps output)

Thanx in advance,
Honored Contributor
Patrick Wallek
Posts: 13,777
Registered: ‎06-21-2000
Message 2 of 4 (117 Views)

Re: Wron process name in ps(1) output ?

I actually see the same behavior on both 11.0 and 11.11 systems here.

I do the same thing as you and on all machines I see the shell preceding the script name in the 'ps' output.

Perhaps it is a patching issue?

On one of my 11.0 systems I have PHCO_18446 and on the other I have PHCO_26274 both of which are 'ps cumulative' patches.

On my 11.11 system I have PHCO_29042 which is the 'ps cumulative' patch for 11.11.
Honored Contributor
Sundar_7
Posts: 1,938
Registered: ‎11-07-2000
Message 3 of 4 (117 Views)

Re: Wron process name in ps(1) output ?

# uname -r
B.11.00
#
# cat 1
#!/usr/bin/ksh
sleep 50
#
# ./1 &
# ps -ef | grep ./1
root 13710 10827 0 09:37:31 pts/tb 0:00 /usr/bin/ksh ./1
#

root@TESTMACHINE: (/root)> uname -r
B.11.11
root@TESTMACHINE: (/root)>
root@TESTMACHINE: (/root)> ./1 &
[1] 6860
root@TESTMACHINE: (/root)>
root@TESTMACHINE: (/root)> ps -ef | grep ./1
root 6860 6811 3 09:37:10 pts/ta 0:00 /usr/bin/ksh ./1
root@TESTMACHINE: (/root)>

I see the same behaviour too !!!!
Learn What to do ,How to do and more importantly When to do ?
Esteemed Contributor
Colin Topliss
Posts: 296
Registered: ‎01-20-1998
Message 4 of 4 (117 Views)

Re: Wron process name in ps(1) output ?

Its a slight change in behaviour. Came across this one several years ago after upgrading from 10.20 to 11i. I think it was something to do with a change to pstat.

It caused me an issue because I used to have a script that looked for something in a line returned by a 'ps -ef' - the extra information meant that the string I was looking for no longer appeared (the length of pstat wasn't long enough).

I had to add an extra option to get more information on the pstat line (ps -efx).

I can't be 100% sure, but I think that the 'x' option was added under 11i (I don't remember it being there under 11.00, but I haven't touched an 11.00 system for ages).

Col
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.