# Retry after cancellation

**URL:** <https://hub.mender.io/t/retry-after-cancellation/2505>\
**Category:** General Discussions\
**Tags:** raspberry-pi-3\
**Created:** [September 27, 2020, 9:20am UTC](https://hub.mender.io/t/retry-after-cancellation/2505 "2020-09-27T09:20:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)\
**Post date:** [September 27, 2020, 9:20am UTC](https://hub.mender.io/t/retry-after-cancellation/2505/1 "2020-09-27T09:20:50Z")

</div>

Hi, in [this](https://hub.mender.io/t/how-to-create-state-scripts-with-mender-using-raspberry-pi/1518) tutorial, the exit status was either 0 to proceed or 21 for retry later. How can the user himself perform a retry at any time he prefers?

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/7f3b7209e554c1982a34bca85513fc2126cfcb91.png)

Here, we could specify exact time after retry. But I want to be more flexible with it

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [September 28, 2020, 7:27am UTC](https://hub.mender.io/t/retry-after-cancellation/2505/2 "2020-09-28T07:27:52Z")

</div>

The state-scripts have a pretty long window, in which they can run. This means that the script itself could halt, waiting for user input. And then given a certain user input, return `21` to the Mender client, which will then retry the script at a user defined interval.

---

<div class="post-metadata">

**Author:** ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)\
**Post date:** [September 28, 2020, 7:32am UTC](https://hub.mender.io/t/retry-after-cancellation/2505/3 "2020-09-28T07:32:16Z")

</div>

Hi @oleorhagen, can you elaborate a bit ?

---

<div class="post-metadata">

**Author:** ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)\
**Post date:** [September 28, 2020, 5:18pm UTC](https://hub.mender.io/t/retry-after-cancellation/2505/4 "2020-09-28T17:18:50Z")

</div>

What I am talking about is esentially what is described here:

> **[State scripts | Mender documentation](https://docs.mender.io/artifact-creation/state-scripts#update-confirmation-by-end-user)**

In which a state-script can be used to request the user for confirmation, I think this is basically what you are looking for from your description.
