Probably you are installing the trap too late. You might also look at Ruby's `at_exit` which might let you do what you need to do.
- Lee Lee Hambley -- http://lee.hambley.name/ +49 (0) 170 298 5667 On 30 May 2013 23:51, Benjamin Fleischer <bfleisc...@gmail.com> wrote: > I also asked on IRC and torrancew led me to try this > > before 'deploy:rollback', 'deploy:unlock' > > def write_deploy_lock(deploy_lock) > put deploy_lock.to_yaml, deploy_lockfile, :mode => 0777 > + # Ensure the lockfile is remove on Interrupt > + trap("INT") { > + STDERR.puts 'Got shutdown signal, removing lockfile' > + remove_deploy_lock > + } > end > > I'm not sure how to test that, but it's what I have for now. I think my > other alternative would be to alias the capistrano handle_errors method to > add my functionality > > If I add a bad github url I get > ERROR: Repository not found. > fatal: The remote end hung up unexpectedly > *** [deploy:update_code] rolling back > Command git ls-remote g...@github.com:...git master returned status code > pid 76578 exit 128 > > but it didn't run the unlock task > > -- > -- > * You received this message because you are subscribed to the Google > Groups "Capistrano" group. > * To post to this group, send email to capistrano@googlegroups.com > * To unsubscribe from this group, send email to > capistrano+unsubscr...@googlegroups.com For more options, visit this > group at http://groups.google.com/group/capistrano?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Capistrano" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to capistrano+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to capistrano@googlegroups.com * To unsubscribe from this group, send email to capistrano+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en --- You received this message because you are subscribed to the Google Groups "Capistrano" group. To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.