Based on this Serverfault question, my git user has permission in sudoers to run a wrapper script to move files into my webroot with git.
Everything is working fine except for the chmod and chown lines. After the script has run, the files are still root:root instead of apache:apache.
#!/bin/sh echo echo "**** Pulling changes into Prime [Hub's post-update hook]" echo cd /usr/local/apache/htdocs || exit unset GIT_DIR git pull hub master exec /usr/libexec/git-core/git-update-server-info chmod -R 0644 /usr/local/apache/htdocs chown -R apache:apache /usr/local/apache/htdocs
Since the script is running as root, why wouldn't the chmod and chown commands be working?