Operating System - HP-UX
1834020 Members
2480 Online
110063 Solutions
New Discussion

detached shared memory owner getting changed

 
Natesan_1
Frequent Advisor

detached shared memory owner getting changed

Configuration:
HPUX 11.23 with AUG04 level patched
Itanium-2 hardware.
Ingres 2.6

Problem:
Where "ipcs -ma" which shows:


T ID KEY MODE OWNER
Shared Memory:
m 5 0x00000000 D-rw----- ingres

Detached process owner shows ingres.we are finding problem with detached segments that the owner changed to root and no of detached shared memory segments increase which was only getting clear by system reboot.

We wanted know,

1.Why the owner getting changed to root.
2.How to get the last attached process along with detached segments?
3.How clear without system reboot?.



INVENT
4 REPLIES 4
Don Morris_1
Honored Contributor

Re: detached shared memory owner getting changed

1) shmctl() with IPC_SET will change the owner of a segment, there's nothing in the kernel that would change the ownership automatically.

2) There's no data on the last attached process per se. The LPID field of ipcs -ma will give the pid of the last process to attach *or* detach, so if X was the last attacher, but Y detached after that, you'd only see Y. If the process is still attached, you can use kernel-intrusive tools like shminfo (ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/)
which will list attached processes.

3) If the segment is marked for Deletion as you indicate above, there is still at least one process attached. When that process goes away, the segment will also go away. It can not be removed until that happens without a reboot... so the question would then become, why isn't that process letting go. In many cases, the program is working as designed -- it is a good practice to bring up your shared memory segments in initialization and then (once you know all processes you care about if you have known children) mark them for deletion. That way if the program terminates early (exception case that isn't handled, etc.) the segments are cleaned up by the system. So -- use shminfo from (2) above, and see what the attached processes are doing. If they're doing useful work -- don't worry about it.
Natesan_1
Frequent Advisor

Re: detached shared memory owner getting changed

Thanks Don for your clarification.
INVENT
Mohanasundaram_1
Honored Contributor

Re: detached shared memory owner getting changed

Hi Nats,

You should definitely do something about the below, in your profile,

I have assigned points to 7 of 44 responses to my questions.

With regards,
Mohan.
Attitude, Not aptitude, determines your altitude
Natesan_1
Frequent Advisor

Re: detached shared memory owner getting changed

Dear Mohan,

I can improve provided I get required response to my questions.(Like Dan reply..)


INVENT