# Aborting a rake task which uses a subprocess

**URL:** <https://www.ruby-forum.com/t/aborting-a-rake-task-which-uses-a-subprocess/82101>\
**Category:** Ruby\
**Created:** [January 17, 2007, 12:40pm UTC](https://www.ruby-forum.com/t/aborting-a-rake-task-which-uses-a-subprocess/82101 "2007-01-17T12:40:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![regularfry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Post date:** [January 17, 2007, 12:40pm UTC](https://www.ruby-forum.com/t/aborting-a-rake-task-which-uses-a-subprocess/82101/1 "2007-01-17T12:40:04Z")

</div>

Hi all,

I’ve got a rake file which I use to deploy a website. This rakefile  
involves running a bunch of backticked subprocesses (like ssh sessions,  
lftp sessions and so on). Often, I can spot that something has gone  
wrong in one of these subprocesses from the output, or realise I’ve  
forgotten something crucial, and want to abort manually.

Hitting Ctrl-C only affects the subprocess that’s running at the time,  
and makes rake just skip on to the next one. Is there any generic way  
of allowing Rake to also catch the signal and abort?
