# Ensuring code executes even if user interrupted

**URL:** <https://forum.ansible.com/t/ensuring-code-executes-even-if-user-interrupted/33371>\
**Category:** Ansible Developer\
**Created:** [July 10, 2020, 6:30pm UTC](https://forum.ansible.com/t/ensuring-code-executes-even-if-user-interrupted/33371 "2020-07-10T18:30:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![afeller](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@afeller](https://forum.ansible.com/u/afeller)\
**Post date:** [July 10, 2020, 6:30pm UTC](https://forum.ansible.com/t/ensuring-code-executes-even-if-user-interrupted/33371/1 "2020-07-10T18:30:20Z")

</div>

Ansible’s [block/rescue](https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html#blocks-error-handling) and [handlers](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#handlers-running-operations-on-change) are mechanisms for flow control, however they don’t guarantee execution whenever the control machine is interrupted. Are there any other hooks that signal handling will perform best attempt to ensure run?
