问题
Why does the capistrano cleanup task hang sometimes and how can I fix it?
It get's to this point and just sits there:
* 2014-01-06 20:52:21 executing `deploy:cleanup'
* executing "sudo -p 'sudo password: ' ls -1dt /var/www/jobfly/releases/* | tail -n +6 | sudo -p 'sudo password: ' xargs rm -rf"
The weirdest thing is that this only happens sometimes. Other times it executes just fine.
I have this as the last line in my deploy.rb:
after "deploy:restart", "deploy:cleanup" # leave the last 5 releases only
回答1:
It seems that if I change set :use_sudo, false it doesn't hang anymore.
来源:https://stackoverflow.com/questions/20963426/capistrano-cleanup-task-hangs-some-times