【问题标题】:Why doesn't SVN hook (post commit) execute?为什么 SVN 钩子(提交后)不执行?
【发布时间】:2014-06-05 11:57:10
【问题描述】:

我正在尝试执行 post-commit 钩子,无论我做什么,我总是得到:

Command: Commit  
Modified: C:\****\somefile.txt
Sending content: C:\****\somefile.txt
Completed: At revision: XX  
Error: post-commit hook failed (exit code 255) with no output.  

目前我的提交后脚本如下所示:

echo TEST >> /srv/subversion/smth/hooks/test.log

我还尝试使用空文件,在特定目录上使用 svn 更新,如果我从 shell 以 su www-data ./post-commit 运行主题,所有变体都可以正常工作。

通过 http (apache) 访问 Repo,因此 www-data 是执行此操作的用户。我的服务器在 Ubuntu 11.10 上,SVN 服务器版本是 1.6.12...

以下是提交后文件的权限:

-rwxr-xr-x 1 www-data www-data 51 2014-06-05 11:52 post-commit

【问题讨论】:

    标签: svn svn-hooks


    【解决方案1】:

    确保www-data 帐户有足够的权限写入/srv/subversion/smth/hooks/test.log。例如,运行命令并检查结果:

    sudo -u www-data echo TEST >> /srv/subversion/smth/hooks/test.log

    【讨论】:

    • 如果我以 root 身份运行此命令,它可以工作...如果我以其他用户身份运行,它不会。在提交后我也试过这个:'echo TEST',我仍然得到同样的错误(没有写入日志)
    猜你喜欢
    • 1970-01-01
    • 2015-03-30
    • 1970-01-01
    • 1970-01-01
    • 2014-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-19
    相关资源
    最近更新 更多