Problem: the user that effectively runs the post-commit script has not always the proper permissions to access the trac database. I experimented with a setuid C wrapper that you find a lot when googling: no success. Setuid post commit script: no success.
The solution was simple: allow your users (in my case a group) to execute
the trac post commit script as the user that runs trac. For this, enter a
line like this in your
# The relevant users are in the "src" group. %src ourhost = (tracuser) NOPASSWD: /path/to/tracpostcommithook
And in your
/usr/bin/sudo -u tracuser /path/to/tracpostcommithook -r $REV ....
Writing it down in this blog post so that I can google it in three years time when I’ve forgotten how to do it :-)
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):