开发者

Capistrano leaving remote tail open

开发者 https://www.devze.com 2023-02-06 07:16 出处:网络
I am using capistrano in a rails-less environment and I\'m having a problem with my remote tail task:

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

精彩评论

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

关注公众号