I updated a server from ubuntu hoary hedgehog to breezy badger. I followed this and it went smoothly enough, although it took a number of
sudo apt-get upgrade sudo apt-get dist=update sudo apt-get update
cycles to stop it installing new packages.
Afterwards my turbogears projects were dead: the apache2 error log files said:
[Mon Feb 20 13:01:21 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:24 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:24 2006] child pid 26833 exit signal Segmentation fault (11) [Mon Feb 20 13:01:25 2006] child pid 26832 exit signal Segmentation fault (11) [Mon Feb 20 13:01:25 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:26 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:27 2006] child pid 26834 exit signal Segmentation fault (11) [Mon Feb 20 13:01:27 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:28 2006] child pid 26835 exit signal Segmentation fault (11) [Mon Feb 20 13:01:29 2006] child pid 26836 exit signal Segmentation fault (11) [Mon Feb 20 13:01:42 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:43 2006] mod_python: (Re)importing module 'mpcp' [Mon Feb 20 13:01:44 2006] child pid 29065 exit signal Segmentation fault (11) [Mon Feb 20 13:01:44 2006] mod_python: (Re)importing module 'mpcp'
Googling, the problem seems to be due to mod_php and mod_python using different versions of the mysql library. By simplifying my project I established that it was indeed due to mysql and not expat which is another possible cause. The solutions provided were to recompile. I decided the simplest thing to recompile would be MySQLdb, the python mysql module, it being the smallest component and I didn't fancy trying to rebuild mod_php. I downloaded the source for MySQLdb and looked through the setup.py file and found this line:
mysqlstatic = eval(os.getenv('mysqlstatic', 'False'))
which implies that MySQLdb can use a static library: excellent. By default it is using a dynamic library which presumably is a different version to the one mod_php is using. I defined the environment variable with
export mysqlstatic=True
and I ran
python setup.py build
This died because it couldn't find something called mysql_config. I installed the libmysqlclient12-dev package with
sudo apt-get install libmysqlclient12-dev
to get this and it built ok. Note that there are three libmysqlclient packages, 10, 12 and 14. 12 appears to be a match for the version of mysql on the server (4.0.24: latest ubuntu is lagging debian somewhat).
I uninstalled the ubuntu MySQLdb package to avoid any future problems and then installed the MySQLdb module with
sudo python setup.py install
I tested the library from the python interactive shell and no problems. I rebooted the apache server and problem solved.
I'll have to keep an eye in this, I can no longer rely on the Ubuntu package system.


i had a problem similar to this once... i fixed it by installing the mpm-prefork instead of the mpm-worker