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)
精彩评论