# Node-Red Exec node shutdown doesn't seem to be working

**URL:** <https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443>\
**Category:** Product support\
**Created:** [October 11, 2019, 4:20pm UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443 "2019-10-11T16:20:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 11, 2019, 4:20pm UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/1 "2019-10-11T16:20:20Z")

</div>

Hi, I’m using a node-red flow to trigger a shutdown of my device if a button is pressed - to allow an engineer to safely shutdown and restart the devices in the field. The issue is that my Exec node does not appear to be working and I’m not getting any return in the logs to explain why. Normally, as soon as the button is clicked the device begins the shutdown process - however, when I pressed the button on my balena device it didn’t appear to do anything. The command I’m using is “sudo shutdown now”. I’m running this on a multi-container, do I need to change the command to ensure that it runs it on the hostOS rather than in my node-red container?

Thanks,  
Gregor

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [October 11, 2019, 4:23pm UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/2 "2019-10-11T16:23:33Z")

</div>

Hello, you need to ask the supervisor to shutdown the device: [https://www.balena.io/docs/reference/supervisor/supervisor-api/#post-v1shutdown](https://www.balena.io/docs/reference/supervisor/supervisor-api/#post-v1shutdown)

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 11, 2019, 4:30pm UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/4 "2019-10-11T16:30:30Z")

</div>

Ahh right, brilliant thanks. I’m just leaving the office now but I’ll set it up and test it on monday. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 14, 2019, 8:37am UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/6 "2019-10-14T08:37:17Z")

</div>

Hi, I tried putting the command $ curl -X POST --header “Content-Type:application/json”   
“$BALENA\_SUPERVISOR\_ADDRESS/v1/shutdown?apikey=$BALENA\_SUPERVISOR\_API\_KEY” but when I pressed the button to trigger a shutdown I got this in the logs:

/bin/sh: 1: curl: not found

Any ideas?

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 14, 2019, 8:41am UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/7 "2019-10-14T08:41:07Z")

</div>

Hi,

`curl` is not installed in your container, can you please update your Dockerfile to install it before calling the command?

---

<div class="post-metadata">

**Author:** ![GregorR1](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@GregorR1](https://forums.balena.io/u/GregorR1)\
**Post date:** [October 14, 2019, 9:04am UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/8 "2019-10-14T09:04:28Z")

</div>

That was the issue, I’ve added that in and its working now. Thanks!

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [October 14, 2019, 10:25am UTC](https://forums.balena.io/t/node-red-exec-node-shutdown-doesnt-seem-to-be-working/36443/9 "2019-10-14T10:25:32Z")

</div>

You’re welcome, please let us know if you need further support.
