# State scripts not running in Debian

**URL:** <https://hub.mender.io/t/state-scripts-not-running-in-debian/8268>\
**Category:** General Discussions\
**Tags:** state-scripts\
**Created:** [May 11, 2026, 2:22pm UTC](https://hub.mender.io/t/state-scripts-not-running-in-debian/8268 "2026-05-11T14:22:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michiel](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Michiel](https://hub.mender.io/u/Michiel)\
**Post date:** [May 11, 2026, 2:22pm UTC](https://hub.mender.io/t/state-scripts-not-running-in-debian/8268/1 "2026-05-11T14:22:53Z")

</div>

I’m fairly new to Mender and I’m trying out state scripts. As a tryout, I created two state scripts, names Idle\_Enter and Idle\_Leave in /etc/mender/scripts/. The scripts are very simple:

#!/bin/sh  
touch /var/lib/mender/idle-enter-hit  
exit 0

However, I see no file being created in /var/lib/mender/, not after a reboot, not after restarting mender-updated, not after creating and finishing a small deployment.

My setup is a raspi with Debian Trixie 64 bit. From what I understood, Idle\_ scripts can be generated in the file system, where Artifact scripts need to be included in the artifact. So what am I doing wrong?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [May 15, 2026, 9:39am UTC](https://hub.mender.io/t/state-scripts-not-running-in-debian/8268/2 "2026-05-15T09:39:10Z")

</div>

Hi @Michiel,

Thanks for reaching out! The reason is probably the missing ordering number in the filenames. The Mender Client expects this pattern:

```auto
<STATE_NAME>_<ACTION>_<ORDERING_NUMBER>_<OPTIONAL_DESCRIPTION>

```

as documented at [State scripts | Mender documentation](https://docs.mender.io/artifact-creation/state-scripts#transitions-and-ordering), so probably renaming the scripts to `Idle_Enter_00` and `Idle_Leave_00` does the trick.

Besides that, make sure that the execute flag is set on them.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![Michiel](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Michiel](https://hub.mender.io/u/Michiel)\
**Post date:** [May 18, 2026, 6:04am UTC](https://hub.mender.io/t/state-scripts-not-running-in-debian/8268/3 "2026-05-18T06:04:12Z")

</div>

Check, I didn’t know the order number was mandatory if you only had a single script. That fixed it, thanks.
