# Contrib-node version management and process restarting

**URL:** https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266
**Category:** Feature Requests
**Created:** [29 October 2019 08:08 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266 "2019-10-29T08:08:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![bohtho](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bohtho/32/6153_2.png) [@bohtho](https://discourse.nodered.org/u/bohtho)
#### Post date: [29 October 2019 08:08 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/1 "2019-10-29T08:08:12Z")

</div>

I’m sure there are clear cut reasons why this is not implemented as this, but I only wonder if it’s technically possible to upgrade nodes in the node-RED palette _and_ restart those parts of the flows with new versions _without_ restarting node-RED as such?

Also if choosing a version of nodes in the palette is feasible.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 October 2019 08:22 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/2 "2019-10-29T08:22:15Z")

</div>

We cannot upgrade the nodes without a restart of the node.js process to load their new code.

> [@bohtho](#):
>
> Also if choosing a version of nodes in the palette is feasible.

The current catalog format doesn't include a history of versions, just the most recent. But it is something to consider.

---

<div class="post-metadata">

### Author: ![bohtho](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bohtho/32/6153_2.png) [@bohtho](https://discourse.nodered.org/u/bohtho)
#### Post date: [29 October 2019 09:22 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/3 "2019-10-29T09:22:51Z")

</div>

That makes sense. And even without that limitation I’m sure there are other reasons not to automatically restart parts of flows for users.

Even when reading release notes first (and sadly not bothering with a staging environment) sometimes there are problems with new versions of nodes, and a quick downgrade would be a very nice option in the UI.

Oh, and a “restart Node-RED” button? Sometimes I don’t have SSH handily available.

Other than that, I love it and node-RED-ing gives me great joy in the evenings of this dark season. Especially when I create something fail-safe which “just works” with above average W.A.F.🙂

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [29 October 2019 09:37 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/4 "2019-10-29T09:37:10Z")

</div>

> Oh, and a “restart Node-RED” button? Sometimes I don’t have SSH handily available.

When node-red stops, it cannot start itself

I see that someone was able to use an [exec node with `node-red-restart`](https://discourse.nodered.org/t/restart-node-red-via-dashboard/15330) (i thought you needed sudo for this but ok, perhaps you could try it)

---

<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: [29 October 2019 20:57 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/5 "2019-10-29T20:57:11Z")

</div>

You do need sudo for node-red-restart, at least on Raspbian/Linux. However you can tell the system not to require a password for systemctl, then you can use sudo (with systemctl in node-red-restart). For a home system which is not accessible to the internet this is probably a minor security risk.

---

<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: [30 October 2019 00:57 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/6 "2019-10-30T00:57:15Z")

</div>

This is what I do - or rather I tell sudo that the user running Node-RED is allowed to issue the systemctl command without requiring a password. It is pretty secure for the most part if you only use that login for Node-RED, have a nice strong passcode and don't allow remote (SSH/VNC) logins for that user.

There is _some_ residual risk from an attacker gaining access and then being able to swap accounts but it is pretty small if you follow standard secure setups which you should be doing anyway if you are allowing remote access to your device.

* * *

Slightly off this topic but just for completeness:

I now have one of my Pi's set up with a flow that will turn on a secure NGROK channel via a Telegram bot. I can use NR remotely then another Telegram bot command turns it off again so I don't need to leave it running. I configure NGROK to only allow HTTPS and I have an uid/pw set up as well. So you need to know the dynamically created URL and the uid and the password. I recon that is plenty of security for something that will only be online typically for maybe an hour very occasionally.

---

<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: [30 October 2019 08:37 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/7 "2019-10-30T08:37:04Z")

</div>

> [@TotallyInformation](#):
>
> I tell sudo that the user running Node-RED is allowed to issue the systemctl command without requiring a password

Yes, that is what I meant, though not what I posted. Not to allow anyone to use systemctl without a password, just the node-red user.

---

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [30 October 2019 09:02 UTC](https://discourse.nodered.org/t/contrib-node-version-management-and-process-restarting/17266/8 "2019-10-30T09:02:25Z")

</div>

You can even set up the sudoers file to only allow commands with specific arguments to be run without password. That way you can allow systemctl for only certain applications, for only specific actions, for example status and restart, but not stop.  
[http://manpages.ubuntu.com/manpages/eoan/en/man5/sudoers.5.html](http://manpages.ubuntu.com/manpages/eoan/en/man5/sudoers.5.html)  
For a practical example, see [https://unix.stackexchange.com/a/366420](https://unix.stackexchange.com/a/366420)
