# Node-RED Self Restart

**URL:** https://discourse.nodered.org/t/node-red-self-restart/432
**Category:** FAQs
**Created:** [27 May 2018 10:46 UTC](https://discourse.nodered.org/t/node-red-self-restart/432 "2018-05-27T10:46:37Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [17 December 2020 21:19 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/21 "2020-12-17T21:19:50Z")

</div>

Welcome to the forum @MattL0.

Do you mean a button on the node-red dashboard? If so you can easily add a button and feed it to your exec node.

> [@MattL0](#):
>
> Like near the node red log on the left

I am not sure what you mean by that. What log?

---

<div class="post-metadata">

### Author: ![MattL0](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mattl0/32/16056_2.png) [@MattL0](https://discourse.nodered.org/u/MattL0)
#### Post date: [23 December 2020 07:06 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/22 "2020-12-23T07:06:50Z")

</div>

Thank you. Sorry i meant logo \*\*

---

<div class="post-metadata">

### Author: ![MattL0](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mattl0/32/16056_2.png) [@MattL0](https://discourse.nodered.org/u/MattL0)
#### Post date: [23 December 2020 07:07 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/23 "2020-12-23T07:07:21Z")

</div>

No I meant directly on the admin ui

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/b/bb2d69654790dc19d673302e706e760f07fe8669.jpeg)

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [23 December 2020 14:49 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/24 "2020-12-23T14:49:09Z")

</div>

You need to read through the latest generation of the settings.js file, you will find something in there that lets you set a URL.

In fact, as I've just broken off for the Christmas Break, I may share my latest settings.js file because I've done an improved layout with better comments. So keep an eye out for another thread in the forum.

---

<div class="post-metadata">

### Author: ![votecoffee](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/votecoffee/32/31932_2.png) [@votecoffee](https://discourse.nodered.org/u/votecoffee)
#### Post date: [13 January 2021 15:26 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/25 "2021-01-13T15:26:26Z")

</div>

If you need to supply a password, you can use the sudo -S option:  
`echo user | sudo -S sudo reboot now`

Alternatively, you can configure an askpass helper by setting the SUDO\_ASKPASS environment variable or modify /etc/sudo.conf.

> <https://askubuntu.com/questions/1124875/how-do-i-set-askpass-variable>

---

<div class="post-metadata">

### Author: ![PaulKana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paulkana/32/37106_2.png) [@PaulKana](https://discourse.nodered.org/u/PaulKana)
#### Post date: [25 February 2021 19:30 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/26 "2021-02-25T19:30:14Z")

</div>

I wonder if it is possible to chain _node-red stop_ with _sudo halt_ on Raspberry Os?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 February 2021 19:59 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/27 "2021-02-25T19:59:49Z")

</div>

Why would you want to do that? If you are running Node-RED under systemd, shutting down the Pi will cleanly shut down Node-RED for you. Actually, I think node-red will cleanly shut down even if running manually since I seem to remember that is a feature of node.js. Test that theory though before relying on it 😁

---

<div class="post-metadata">

### Author: ![PaulKana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paulkana/32/37106_2.png) [@PaulKana](https://discourse.nodered.org/u/PaulKana)
#### Post date: [25 February 2021 22:23 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/28 "2021-02-25T22:23:51Z")

</div>

Hey, thanks for the information! The reasoning was to have the persistent storage written to disk, I wasn’t sure that shutting down the system directly would accomplish that.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 February 2021 23:47 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/29 "2021-02-25T23:47:42Z")

</div>

Yes, I believe so, it should flush on close. You could always test it by setting the timeout to something long and then update a variable and close node-red straight away if you wanted to.

---

<div class="post-metadata">

### Author: ![PaulKana](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paulkana/32/37106_2.png) [@PaulKana](https://discourse.nodered.org/u/PaulKana)
#### Post date: [26 February 2021 13:28 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/30 "2021-02-26T13:28:20Z")

</div>

Hey, it seems that you are right, shutting down the rpi through the Shutdown RPi node writes the global values to filesystem before shutting down the RPi.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [26 February 2021 14:08 UTC](https://discourse.nodered.org/t/node-red-self-restart/432/31 "2021-02-26T14:08:54Z")

</div>

Phew, I thought I'd seen that but always good to have it verified 😁

Thanks.

[Previous page](https://discourse.nodered.org/t/node-red-self-restart/432.md?page=1)
