Nedelcho Stanev wrote:

sending this twice, since i did'n get this in mail list.
may be there are some problem

mailing list is probable VERY slow, thanks to all the worms


to clean up your shared memory, try looking at ipcs and ipcrm.
you need to remove the shared memory segments from ther via ipcrm.
man ipcrm/ipcs for more info.
(just be careful to remove only the ones you created ;-)
 ?

----- Original Message ----- From: Nedelcho Stanev To: [EMAIL PROTECTED] Sent: Friday, August 15, 2003 2:43 PM
Subject: apr_shm_create



Hello All,


i have this problem when i use shared memory with Apache.
Apache is 2.0.47, compiled on Red Hat linux 8 with kernel 2.4.18-14.
Same module and same Apache on Windows work perfect, but on linux
i have some problems.
so ...
i create shared memory block with sts = apr_shm_create(&client_shm, shmem_size, MOD_MQUBE_SHMEMFILE, ctx);
in initialize_module of my module.
in same function i add cleanup callback with apr_pool_cleanup_register
in this callbeck i do cleaning with
apr_shm_destroy(client_shm);
client_shm = NULL;


when i stop and start apache properly all works perfect :) but
if server crash, or i kill it with -9 , then in /tmp directory i still have MOD_MQUBE_SHMEMFILE file still. and this is ok, because cleanup callback is not called
but when i start again apache apr_shm_create doesent work.
goin in a deep, i see that in sorce of this function ( unix/shm.c)
problem come from here :
if ((new_m->shmid = shmget(shmkey, new_m->realsize,
befor this line we have
status = apr_file_open(&file, filename, and this create file correctly
but shmget return error - File exists


so, does anyone know why this happens? :)
btw , same effect is if i don't delete this file from tmp directory
but, even if i delete it apache cannot allocate shared memory.


decho








Reply via email to