Subject: Mod_python and apache 2 (semaphore) problems.
To: None <netbsd-help@netbsd.org>
From: Berteun Damman <berteun@gmail.com>
List: netbsd-help
Date: 01/15/2005 16:48:56
Hello,

I was trying to activate mod_python with Apache 2, so I've installed
ap2-py23-python-3.1.3nb1 from the ports (along with
python23-2.3.4nb3), and added:

LoadModule python_module libexec/mod_python.so 

to apache.conf. Furthermore I've followed the instructions on
http://www.modpython.org/live/current/doc-html/inst-testing.html, and
made that test page.

The first time I started it and tried to view the page, the logs gave:

[Sat Jan 15 15:58:54 2005] [warn] Init: Session Cache is not
configured [hint: SSLSessionCache]
[Sat Jan 15 15:58:57 2005] [notice] mod_python: Creating 32 session
mutexes based on 150 max processes and 0 max threads.
[Sat Jan 15 15:58:57 2005] [error] (28)No space left on device:
mod_python: Failed to create global mutex 14 of 32
(/tmp/mpmtx1643414).
[Sat Jan 15 15:58:57 2005] [error] mod_python: We can probably
continue, but with diminished ability to process session locks.
[Sat Jan 15 15:58:57 2005] [error] mod_python: Hint: On Linux, the
problem may be the number of available semaphores, check 'sysctl
kernel.sem'
[Sat Jan 15 15:58:57 2005] [notice] Digest: generating secret for
digest authentication ...
[Sat Jan 15 15:58:57 2005] [notice] Digest: done
[Sat Jan 15 15:58:58 2005] [notice] mod_python: (Re)importing module 'mptest'
Fatal Python error: PyThreadState_Delete: tstate is still current

Okay, something seems to go wrong, and successive restarts of apache
only give this:
[Sat Jan 15 16:26:00 2005] [error] (28)No space left on device: Cannot
create SSLMutex
Configuration Failed

And it quits.

Some Googling gave me:
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=26347

With the comment that "It seems to have gone away with 2.0", but
that's what I'm running (though  I'm runing a custom kernel, which
has:
options         SEMMNI=20       # number of semaphore identifiers
options         SEMMNS=90       # number of semaphores in system

instead of the defaults (I've changed that, because before I was
running OpenBSD, and it always had too few semaphores to run
PostgreSQL, which required me to recompile the kernel, so I decided to
add some semaphores to my own kernel too). If there's good evidence
this might cause the problem I can recompile my kernel with the
default values and try again.

It now seems I cannot get Apache 2 working again unless I reboot, just
like described overhere:
http://www.modpython.org/pipermail/mod_python/2004-May/015613.html

I hope someone can clarify this, or give some good hints for extra
information (httpd -X does not give everything, it just immediately
quits).

Berteun