I have a hook which executes a git pull but it fails when it needs to write added files. The user it operates as is apache, and it can execute the git pull fine when write permissions are granted to it (via adding apache to a group with write access).
I have come up with a few solutions...
However, all of these seem like either insecure/hacky solutions.
Please share any suggestions or methods you have used to get around these problems. I am curious to hear any solution, especially if you've had to jump this hurdle yourself.
Another solution (possibly old-school) is to create a setuid program to perform the actual work, then run that setuid program from the hook.
If you are running with SELinux, you may need to tweak the permissions to get the setuid program to run from the hook, given that the hook runs as the Apache user.