Operating System - HP-UX
1830939 Members
2740 Online
110017 Solutions
New Discussion

HPUX 11i ps output format

 
SOLVED
Go to solution
Donald O'Brien
Advisor

HPUX 11i ps output format

Hello all,

I have recently begun to upgrade several systems from HP-UX 10.20 to 11.11. I have been using the "cold installation" method where I completely overwrite the vg00 volume group disks when installing 11.11.

Everything has gone well, but I have run into an odd problem. There has been a change to the output format of the "ps -e" command that is causing a previously working script to fail. In fact this script works ok on HP-UX 11.11 systems which have the OS factory installed. But after my cold installs it fails everytime.

Good Outputs on a working HPUX 11.11 system.

ps -e : 22387 pts/tb 0:00 ntwk_watchdog_
ps -ef: hlisys 22387 22274 4 15:39:09 pts/tb 0:00 /bin/ksh react-2001/ntwk_watchdog_start.cmd logicals

Notice the "ntwk_watchdog_" process name on the "ps -e" output. That is what the script is keying on.

Now after my HP-UX 11.11 installation, the output now looks like this.

ps -e : 21464 console 0:00 ntwk_watchdog
ps -ef: hlisys 21464 21355 6 16:41:47 console 0:00 /bin/ksh react-2001/ntwk_watchdog_start.cmd logicals

Notice that the underscore has been removed from the process name in the ps -e output. The script is looking to kill any "ntwk_watchdog" processes, but its seeing itself (ie ntwkwatchdog_start.cmd) as a process since the underscore is being left out of the "ps -e" output.

I have tried setting the UNIX95 env var to "XPG4", but that only results in this output.

ps -e : 3893 console 00:00 ksh
ps -ef:hlisys 3893 3784 4 11:56:44 console 00:00 /bin/ksh react-2001/ntwk_watchdog_start.cmd logicals

So that is not the same. I don't want to sent this problem back to programmers to work around this issue since the script clearly works on many existing HP-UX 11.11 systems.

My question/problem is, What setting am I missing that causes the differentiation between the outputs of the "ps -e" commands between the two HPUX 11.11 senarios?

Thanks,
Donald O'Brien.
10 REPLIES 10
Donny Jekels
Respected Contributor

Re: HPUX 11i ps output format

Donald,

Is your program compiled, and if so do you have the source?

Is it a perl/shell script?

If so then you can modify the tool.

Otherwise play around wiht the many switches that comes with ps.

I tried ps -efl and see alot more than just ps -e

Donny
"Vision, is the art of seeing the invisible"
Patrick Wallek
Honored Contributor

Re: HPUX 11i ps output format

I doubt that its a setting anywhere. Most likely it is a patch issue. Look at the patch levels on the system, particularly look for any 'ps cumulative' patch.

See if the systems it works on have a more recent patch than the systems you are cold installing. It could also be the other way around; the systems it works on may have an older version of a patch and newer patches may "break" ps from your perspective.

Donny Jekels
Respected Contributor

Re: HPUX 11i ps output format

another possibility is to download gnu core_utils and recompile ps yourself.

always fun to do!!!

enjoy
Donny
"Vision, is the art of seeing the invisible"
Pete Randall
Outstanding Contributor

Re: HPUX 11i ps output format

Donald,

To me, this smells like a patch issue. Check to see if you have either of these "ps" patches: PHCO_29042 or PHCO_30397.

If either of both are missing, I would first apply those before I tried to debug this any further.


Pete

Pete
Donald O'Brien
Advisor

Re: HPUX 11i ps output format

It is just a shell script. Its looking for the "ntwk_watchdog" process. If it see it in the "ps -e" output, it takes the PID and kills it. It dismisses correctly the "ntwk_watchdog_" process if its present in the "ps -e" output.

It could be a case of "patched beyond the point of operability", but I sure hope not. Its just that darn underscore that's being left off thats getting me here.
Pete Randall
Outstanding Contributor

Re: HPUX 11i ps output format

Actually, that was kind of stupid - they're cumulative, so, if missing, just apply the latest, not both.


Pete

Pete
RAC_1
Honored Contributor

Re: HPUX 11i ps output format

You should be fine using following.

UNIX95= ps -Cntwk_watchdog -o "pid,ruser"

Anil
There is no substitute to HARDWORK
Donald O'Brien
Advisor

Re: HPUX 11i ps output format

I installed patch PHCO_30397, but it did not change the behavior of the "ps -e" output.

I also agree that the script could use a better command, but it works on some existing 11.11 systems, so that I what I am trying to match.
Armin Kunaschik
Esteemed Contributor
Solution

Re: HPUX 11i ps output format

This might not a big help but did you try to
contact HP and let them do the dirty debugging? :-)

You hopefully have a support contract?

Other things to try:

ps -ex to show long lines
Somehow the line length is limited by the terminal or by some other obscure reason

UNIX95 makes only sense if used like
ps -eo pid,comm
or
ps -eo pid,args

Hope this helps,
Armin
And now for something completely different...
Armin Kunaschik
Esteemed Contributor

Re: HPUX 11i ps output format

Just noticed:

Both line lengths are equal:
21464 console 0:00 ntwk_watchdog
22387 pts/tb 0:00 ntwk_watchdog_

Try changing your login method i.e. login over
the network rather than over console.
This will give you 1 "spare" character, use
telnet (= use ttypX) to get another one.

This is just to verify the reason...
You should hardly change the script :-)

Armin
And now for something completely different...