开发者

Capistrano leaving remote tail open

I am using capistrano in a rails-less environment and I'm having a problem with my remote tail task:

role :web, "pants@host1", "pants@host2"
task :weberror, :roles => :web do
    stream("tail -f /var/log/httpd/error_log | sed \"s/^/\033[0;32m$HOSTNAME:\033[0开发者_运维百科m /\"")
end

If I press Ctrl+C to get out of the command, the tail command is left open on the server forever. Is there an alternate way to break with capistrano that cleans up the process or am I doing something wrong with my task?


Have you tried adding the pty option to stop buffering.

stream(..., :pty => true)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜