Operating System - HP-UX
1834089 Members
2274 Online
110063 Solutions
New Discussion

Removal of shared memory items removal system

 
Gregorio Rivera Jr.
Occasional Contributor

Removal of shared memory items removal system

I Need to find out, why on only one server when we stop all packages that are using the shared memory, queues and semaphore and attempt to clear them with the "ipcrm" command the server crashes except when only removing the "shared memory". What is causing the server to crash when removing the other shared memory items. The process that is being used to remove the shared memory after the packages are stopped is

ipcs -b |egrep "asms|mqm|wnp|splex|ora" |awk '{print $1, $2, $5}' | while read TYPE PROC USR
do
echo "ipcrm -$TYPE $PROC $USR"
ipcrm -$TYPE $PROC
done
HP RP8400 Servers
HP UX 11.11
4 REPLIES 4
Paula J Frazer-Campbell
Honored Contributor

Re: Removal of shared memory items removal system

Hi

Run :-

ipcs -b |egrep "asms|mqm|wnp|splex|ora" |awk '{print $1, $2, $5}'

and make sur your egep is not picking up a system process.

Paula
If you can spell SysAdmin then you is one - anon
Patrick Wallek
Honored Contributor

Re: Removal of shared memory items removal system

My guess would be that you are removing something that you shouldn't.

I would be real leary of scripting something like ipcrm.

I prefer to do that manually and double and triple-check what I am removing.

I would try going through the list and manually use ipcrm and see which segment causes you problems.
Gregorio Rivera Jr.
Occasional Contributor

Re: Removal of shared memory items removal system


Further info on problem.

Another admin ran the script without the ipcrm bit and it only returned values that should be safe to remove. Removing them singly did not cause a crash.

Also keep in mind that we have two almost identical 8400s and its only happening on one of the servers.

Jeff Schussele
Honored Contributor

Re: Removal of shared memory items removal system

Hi Gregorio,

Here is probably the #1 reason why you must be very careful with ipcs/ipcrm loops - quote from ipcs man page:

WARNINGS

ipcs produces only an approximate indication of actual system status because system processes are continually changing while ipcs is acquiring the requested information.

Do not rely on the exact field widths and spacing of the output, as these will vary depending on the system, the release of HP-UX, and the data to be displayed.

EndQuote

So it's entirely possible that things change between the ipcs & ipcrm sections of that script.

We use a perl script to do this with only one user at a time & we do not use the -b in case it may push data fields to wrap. So you might try the loop with just ipcs & not ipcs -b & try the script one user at a time - you may discover the "culprit" that way.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!