I solved the problemm by noticing that the scripts in /var/lib/defoma/scripts were all empty. Strang as it is, these scripts don't get regenerated on reinstalling. I copied them from an old backup.