On Wed, May 26, 2004 at 09:43:38PM +0530, Amit Athavale wrote: > Graham Leggett wrote: > > >Ok - what I would like to do is put information on what needs to be > >done in the error message, so that when mod_ldap starts and the shared > >memory goes pear shaped, the admin is given exact instructions on what > >to do to fix it, this removing your step 4 above, and hopefully also > >step 6. [1] > > > >Something like: "LDAP cache: shared memory segment could not be > >created due to problems with an unclean shutdown. Please run 'ipcrm -m > >XXXX' to fix this." > > > >How would I get the XXXX part? Is this returned anywhere? > > I don't think it is possible. APR does not pass back any information > in case of error, other than error code itself. (and anyway XXX is shmid > returned by shmget() which is failing in your case)
Agreed. The answer is that the name-based shm interface is not useful; always use anonymous shm by default and all the headaches go away. I guess it could be made useful either by having apr_shm_create() remove an existing shm segment with the given name then re-create it (as MM does IIRC), or to add an apr_shm_remove() function which removes a name-based shm segment as only APR knows how. joe