Shutdown Node

1,286 views
Skip to first unread message

Joshua Finnegan

unread,
Jun 3, 2015, 9:30:58 AM6/3/15
to node...@googlegroups.com
Just to clarify I'm pretty new to nodered
Is it possible to create a node that shuts nodered down using the command 'shutdown -p now'.
This is possible with the node 'exec' but that involves input. I don't want any user input into this except for maybe pressing a button to trigger it.
All help appreciated

The ThingBox

unread,
Jun 3, 2015, 9:59:00 AM6/3/15
to node...@googlegroups.com
We do this in theThingbox.io: we have a menu to restart NR and one to reboot the Thingbox. Linked to an exec node that reboot.

The pb is that if we often need to reboot because NR is down, and in this case, it just don't work to use NR to reboot!

it seems NR does not run the flow if node classes are missing. This is a pb since missing node classes usually just prevent only a part of the flow to run.

Nicolas

The ThingBox Project - A ready to flash Raspberry Pi image that contains Node-RED and Internet Of Things software for non developers.

Joshua Finnegan

unread,
Jun 4, 2015, 4:45:24 AM6/4/15
to node...@googlegroups.com
Thank you for your reply. Though is there a way to do this on windows OS as I don't have a Pi

Nicholas O'Leary

unread,
Jun 4, 2015, 5:01:37 AM6/4/15
to Node-RED Mailing LIst
Hi Joshua,

if you want to just stop node-red, you could use an exec node that will run taskkill with the appropriate arguments (not a Windows user here, but there are plenty of guides for using taskkill out there.)

if you want to shutdown the machine, again, an exec node that calls shutdown with the appropriate arguments should be all you need.

Nick

On 4 June 2015 at 09:45, Joshua Finnegan <joshuafi...@gmail.com> wrote:
Thank you for your reply. Though is there a way to do this on windows OS as I don't have a Pi

--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Scargill

unread,
Jan 2, 2016, 11:37:26 AM1/2/16
to Node-RED
If I'm right you have one to reboot the Pi and another to reboot Node-Red but not one to actually shut down the Pi - I'm still working on that after my normal "shutdown now" command failed :-)

Dave C-J

unread,
Jan 2, 2016, 3:51:27 PM1/2/16
to node...@googlegroups.com
Peter
shutdown is a root command so you need to either run Node-RED as root - or give shutdown the suid .
But this does mean that any user can then run shutdown...

sudo chmod u+s /sbin/shutdown

Dave C-J

unread,
Jan 2, 2016, 5:51:46 PM1/2/16
to Node-RED
In fact ... on Pi that is a VERY BAD way to do it.... as they alias poweroff, shutdown, reboot and a load of other things to the same underlying app... so giving suid to one does it for all... which obviously is not what you want...

peters...@googlemail.com

unread,
Jan 2, 2016, 5:56:02 PM1/2/16
to node...@googlegroups.com

In Thingbox you are root! I will try those switches thanks

--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/DcWGOXGgmOw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

Peter Scargill

unread,
Jan 3, 2016, 8:42:43 AM1/3/16
to Node-RED
I'm sure it is just me - I cannot find any way to turn THETHINGBOX off ! You can reboot - you can restart node-red but I am not seeing any way to turn the Pi off - either in Thethingbox itself - or on the web (related to this - obviously one would normally use something like shutdown in a terminal etc). Surely if this is to encourage people who are not programmers there should be a shutdown button in the program - or am I looking straight at it and not seeing it.

Dave C-J

unread,
Jan 3, 2016, 10:54:04 AM1/3/16
to node...@googlegroups.com
Best try the Thingbox forum....

Peter Scargill

unread,
Jan 3, 2016, 11:16:05 AM1/3/16
to node...@googlegroups.com

Couldn’t find one – anyway, all figured out and on the blog!

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J
Sent: 03 January 2016 15:54
To: node...@googlegroups.com
Subject: Re: [node-red] Re: Shutdown Node

 

Best try the Thingbox forum....

Reply all
Reply to author
Forward
0 new messages