Operating System - HP-UX
1843997 Members
2282 Online
110226 Solutions
New Discussion

command line/arg buffer length

 
SOLVED
Go to solution
Steve Faidley
Valued Contributor

command line/arg buffer length

Does anyone know if there is a way to increase the buffer space length for command lines?

Our Corp Security wants us to write a script that will verify what WebSphere servers/apps are running. It so happens that IBM in their infinate wisdom puts out a $#%& command line that is up to 2000 characters long, and the info needed is at the end. Per the man page for ps;
Only a subset of the command line is saved by the kernel; as much of the command line will be displayed as is available.
I have tried the -x and -efox (UNIX95=) but they only seem to return around 1024 characters.

So I guess what I'm asking is, what kernel parm in the .h files (and what file) can be changed to allow this? It appears that SUN and AIX either do not limit this or their limit is longer then HP's.

I can see Corp Security telling us we can not us HP boxes for our WEB/WebSphere servers any longer if this can not be resolved.

Thanks in advance for your time.



If it ain't broke, let me have a look at it.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: command line/arg buffer length

Hi Steve:

I think you are limited to 1020 characters. This is documented in 'pstat(2)'.

You would need more than just the C-header files to change this, and HP-UX isn't open-source.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: command line/arg buffer length

You are up against a hard kernel limit (that seems very reasonable to me). All of the SOX standards that I have worked with typically have a clause like "2000 characters or the maximum permitted by the technology". In any event, the only workaround that comes to mind is a wrapper that saves ${$} (PID) plus the entire command line to a file and then execs the "real" command. Your ps -e command now is parsed and the PID is extracted. You then read this file for the full command line matching the PID. There would have to be a cleanup routine to purge expired entries.
If it ain't broke, I can fix that.
Steve Faidley
Valued Contributor

Re: command line/arg buffer length

Thanks for the replies.

I was afraid that might be the answer.

Yes Clay, thats the "last resort" idea we came up with also.

I guess I need to find a new place of work that still uses HP, because I hate SUN and AIX!!!







If it ain't broke, let me have a look at it.