EC2 用户数据脚本在 SVN 更新期间崩溃
我正在尝试使用 EC2 用户数据脚本 shebang 功能来更新已在实例的 EBS 映像上签出的 SVN 存储库,然后运行一些其他命令。该脚本在执行 svn up 命令期间持续崩溃,导致存储库中的大部分或全部文件处于锁定状态。 svn up
命令之后的任何命令均不运行。
我的用户数据脚本如下所示:
#!/bin/bash
echo "about to update..." >> /home/ubuntu/test.log
svn up /home/ubuntu/path/to/repository
echo "update finished" >> /home/ubuntu/test.log
svn up 未正确完成,第二个 echo
命令未执行。
我没有在任何日志中看到任何错误(我不太确定应该搜索哪些日志,但我已经查看了所有明显的日志)。有什么想法为什么 svn 会失败吗?
I'm trying to use EC2 user data script shebang functionality to update an SVN repository that is already checked out on the instance's EBS image and then run some other commands. The script is consistently crashing during the svn up
command, leaving most or all of the files within the repo in a locked state. None of the commands after the svn up
command run.
My user data script looks like this:
#!/bin/bash
echo "about to update..." >> /home/ubuntu/test.log
svn up /home/ubuntu/path/to/repository
echo "update finished" >> /home/ubuntu/test.log
The svn up does not finished correctly and the second echo
command does not execute.
I'm not seeing any errors in any logs (I'm not exactly sure which logs I should be scouring over, but I've looked through all the obvious ones). Any ideas why svn would be failing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
权限问题?尝试:
Permissions problem? Try:
我终于找到了一种方法来让它发挥作用。我没有直接在用户数据脚本中调用 svn up ,而是编译了一个简单的 C 应用程序来执行 svn up 并在用户数据脚本中执行:
不幸的是,我不太确定为什么会这样作品。我想尝试一下,因为我们在 SVN post-commit hook 中遇到了类似的问题,需要相同的解决方案。
I finally figured out a way to get this working. Instead of calling
svn up
directly within my user data script, I compiled a simple C app that does the svn up and execute that in the user data script instead:Unfortunately, I'm not quite sure why this works. I thought to try this because we had a similar issue in a SVN post-commit hook that required the same solution.