Can't find the node-red service

2,215 views
Skip to first unread message

Brian Orpin

unread,
Oct 21, 2016, 3:00:08 PM10/21/16
to Node-RED

This might seem daft, but I installed Node-Red ages ago on a Pi, possibly before there was a rasbian package and now I can't find it, or to be more precise cannot find the service listed.


I know it is stated at boot and is running as I can connect to the web interface (and it is working) but a systemctl status nodered tells me it is dead and a service --status-all does not list it. There is nothing in the init.d directory that might start it.


A 'ps -aux' simply states 'node-red' with no path or anything.


From the web interface it says it is version 0.15.1 and this matches the info from aptitude show nodered so I think the apt-get installed version is what is running.


I have a feeling that at some time I played with node-red-pi but don't know what I did with it.


Can anyone tell me how this is being started at boot?

Colin Law

unread,
Oct 21, 2016, 4:54:10 PM10/21/16
to node...@googlegroups.com
Copy/paste the full results from
sudo systemctl status nodered
and
apt-cache policy nodered


Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/527a05cc-2252-417f-8832-bdd3c45ebe46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Orpin

unread,
Oct 22, 2016, 12:05:27 AM10/22/16
to Node-RED
Hi Colin,

sudo systemctl status nodered

● nodered.service - Node-RED graphical event wiring tool.
   Loaded: loaded (/lib/systemd/system/nodered.service; disabled)
   Active: inactive (dead)
     Docs: http://nodered.org/docs/hardware/raspberrypi.html

apt-cache policy nodered

nodered:
  Installed: 0.15.1
  Candidate: 0.15.1
  Version table:
 *** 0.15.1 0
        500 http://archive.raspberrypi.org/debian/ jessie/main armhf Packages
        100 /var/lib/dpkg/status

Both off a fresh boot and I can access it via a browser (from another machine).

Cheers


On Friday, 21 October 2016 21:54:10 UTC+1, Colin Law wrote:
Copy/paste the full results from
sudo systemctl status nodered
and
apt-cache policy nodered


Colin
On 21 October 2016 at 20:00, Brian Orpin <brian...@gmail.com> wrote:

This might seem daft, but I installed Node-Red ages ago on a Pi, possibly before there was a rasbian package and now I can't find it, or to be more precise cannot find the service listed.


I know it is stated at boot and is running as I can connect to the web interface (and it is working) but a systemctl status nodered tells me it is dead and a service --status-all does not list it. There is nothing in the init.d directory that might start it.


A 'ps -aux' simply states 'node-red' with no path or anything.


From the web interface it says it is version 0.15.1 and this matches the info from aptitude show nodered so I think the apt-get installed version is what is running.


I have a feeling that at some time I played with node-red-pi but don't know what I did with it.


Can anyone tell me how this is being started at boot?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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.

Colin Law

unread,
Oct 22, 2016, 3:45:17 AM10/22/16
to node...@googlegroups.com
Strange. Two possibilities are that you have somehow got two instances of node-red installed so the running one is not the one controlled by systemd, or alternatively you are somehow starting it by a route other than systemd.

What does
which node-red
show? It should be /usr/bin/node-red

Also reboot and leave it a few minutes to settle down then run
grep -i "node-red" /var/log/syslog
Then paste here what you see. Only output from after the reboot are required.  Hopefully that may show how it is being started.

Colin

Brian Orpin

unread,
Oct 22, 2016, 5:08:10 AM10/22/16
to Node-RED
Yes node-red is where you would expect it to be.

Output from syslog

Oct 22 04:02:07 server-pi Node-RED[243]: Welcome to Node-RED
Oct 22 04:02:07 server-pi Node-RED[243]: ===================
Oct 22 04:02:07 server-pi Node-RED[243]: 22 Oct 04:02:07 - [info] Node-RED version: v0.15.1
Oct 22 04:02:07 server-pi Node-RED[243]: 22 Oct 04:02:07 - [info] Node.js  version: v0.10.29
Oct 22 04:02:07 server-pi Node-RED[243]: 22 Oct 04:02:07 - [info] Linux 3.18.0-trunk-rpi arm LE
Oct 22 04:02:18 server-pi Node-RED[243]: 22 Oct 04:02:18 - [info] Loading palette nodes
Oct 22 04:02:33 server-pi Node-RED[243]: 22 Oct 04:02:33 - [warn] Cannot find Pi RPi.GPIO python library
Oct 22 04:02:58 server-pi Node-RED[243]: 22 Oct 04:02:58 - [info] Dashboard version 2.1.0 started at /ui
Oct 22 04:03:21 server-pi Node-RED[243]: 22 Oct 04:03:21 - [rpi-ledborg] Info : Can't find RPi.GPIO python library.
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] ------------------------------------------------------
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] [rpi-gpio] Warning : Cannot find Pi RPi.GPIO python library
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] [smartplug] Error: Cannot find module 'edimax-smartplug'
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] [ledborg] Warning : Can't find RPi.GPIO python library.
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] [sensehat] Error: Can't find Sense HAT python libraries. Run sudo apt-get install sense-hat
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [warn] ------------------------------------------------------
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [info] Settings file  : /root/.node-red/settings.js
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [info] User directory : /root/.node-red
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [info] Flows file     : /root/.node-red/red.js
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [info] Server now running at http://127.0.0.1:1880/
Oct 22 04:03:22 server-pi Node-RED[243]: 22 Oct 04:03:22 - [info] Starting flows
Oct 22 04:03:23 server-pi Node-RED[243]: 22 Oct 04:03:23 - [info] Started flows
Oct 22 04:03:23 server-pi Node-RED[243]: 22 Oct 04:03:23 - [info] [mqtt-broker:486fef71.cc5da8] Connected to broker: mqtt://localhost:1883

What I cannot find is what / how it is being started!

Cheers

Mark Setrem

unread,
Oct 22, 2016, 5:59:18 AM10/22/16
to Node-RED
Why not copy your flows off the Pi, and then start again with a new raspbian image.

Dave C-J

unread,
Oct 22, 2016, 6:01:56 AM10/22/16
to node...@googlegroups.com
Brian

the typical ways to start are a) systemd (which seems not to be the case)
b) init.d c) pm2 d) rc.local
As Colin suggests, running    which node-red    may give us a clue as to what is going on.
We think it's not systemd - but to be sure run
  sudo systemctl disable nodered.service
to disable it... just in case and restart...
if still there - then look in /etc/init.d - there may be a nodered file. If so that's the init.d way... 



Colin Law

unread,
Oct 22, 2016, 6:06:06 AM10/22/16
to node...@googlegroups.com
On 22 October 2016 at 10:08, Brian Orpin <brian...@gmail.com> wrote:
Yes node-red is where you would expect it to be.

Output from syslog

Oct 22 04:02:07 server-pi Node-RED[243]: Welcome to Node-RED

If Brian's suggestion does not help then look in the full syslog to see if there is anything before that line that gives you a clue.

Otherwise I suggest removing node-red and re-install it in the hope that you will get rid of whatever is starting it.
sudo apt-get remove --purge nodered
sudo apt-get autoremove
Then reboot and see if there are any node red messages in the log that might tell you whether it is still trying to start it.
Then reinstall
sudo apt install nodered
and reboot to check it does not run. Then, as I guess you know,
sudo systemctl start|stop|restart nodered
to run it and
sudo systemctl enable nodered
to autorun on boot.

Colin


Brian Orpin

unread,
Oct 22, 2016, 9:58:26 AM10/22/16
to Node-RED
I have a ton of stuff on this Pi, boots off an HDD so not a simple task to rebuild (not a std raspbian image to start with either).

Brian Orpin

unread,
Oct 22, 2016, 10:11:38 AM10/22/16
to Node-RED
Hi Dave,

Thanks. 

a). Systemd shows the service to be disabled.
b). There is no entry in init.d and service --status-all does not list it.
c). Never heard of pm2 so doubt it but how could I check?
d). rc.local - checked the file and it has no entries but how could I check?

which node-red gives /usr/bin/node-red

i can see the process is running from

ps -aux | grep "node"

root       243  0.1 14.4 113604 64548 ?        SNsl 04:00   1:11 node-red

I really am at a loss as to what is starting it :(

Cheers

Dave C-J

unread,
Oct 22, 2016, 12:49:07 PM10/22/16
to node...@googlegroups.com
Well, PM2 is an application you have to install so you would know if you had... and rc.local is just a file that gets executed during boot - so is a place where you can put things you want to autostart  - but again if blank that can't be it...

The only slightly unusual thing is that the Linux is very old (3.18 - vs 4.4 currently)... so is this running Wheezy or Jessie ? If still Wheezy then the /etc/init.d way would be the more normal way... but there's nothing there...

OK - I'm sort of at a loss now also... but then again... most people have trouble getting Node-RED to start and stay running... so you are definitely ahead of the game :-) 

Brian Orpin

unread,
Oct 22, 2016, 1:28:56 PM10/22/16
to Node-RED
I think it was originally Jessie (just) but I might be wrong.  I do a regular update / upgrade.  It does have quite a lot happening on it so I am always reluctant to do too much to it!

Cheers

Colin Law

unread,
Oct 22, 2016, 2:30:17 PM10/22/16
to node...@googlegroups.com
Have you tried this yet?

Colin

 

Colin



Julian Knight

unread,
Oct 24, 2016, 8:50:13 AM10/24/16
to Node-RED
You may need to do a "sudo apt-get dist-upgrade" rather than just an upgrade. That should bring everything to the latest settings. Of course, there is some risk in doing that.

To get all the details about the Node-RED process, you only need to look into the PROC filing system. In the output you give for ps, the PID for Node-RED is 243 so:

sudo ls -la /proc/243

Will show you everything that is available. In particular, you will see that the cwd and exe entries are links to the service working folder and the actual executable.

In addition, if you run "sudo top" and hit "f" you can change the visible data. Turn on the parent PID. The parent pid will also be listed in top so you can see what created the process. In my case, the PPID is 1 which is systemd.

Brian Orpin

unread,
Oct 24, 2016, 10:55:28 AM10/24/16
to Node-RED
Hi Julian, great thanks.

so,
sudo ls -la /proc/243
gives (amongst other things)

lrwxrwxrwx  1 root root 0 Oct 24 14:34 cwd -> /var/node-red
lrwxrwxrwx  1 root root 0 Oct 22 04:00 exe -> /usr/bin/nodejs

The PPID of the node-red process is 1 which is systemd. AIUI, systemd works on scripts in the init.d directory. which also cascades into anything in the file /etc/rc.local

Is there anywhere else systemd looks in for a script to run?

Cheers

Brian

Brian Orpin

unread,
Oct 24, 2016, 10:57:21 AM10/24/16
to Node-RED
Hi Colin,  I'd rather not break the working system unless I have to :(

<snip>

Colin Law

unread,
Oct 24, 2016, 12:35:07 PM10/24/16
to node...@googlegroups.com
On 24 October 2016 at 15:57, Brian Orpin <brian...@gmail.com> wrote:
Hi Colin,  I'd rather not break the working system unless I have to :(

I presume that comment means that you have not recently made an image dump of your SD card.  Take a fresh image dump before you try it.  Then if catastrophe ensues (unlikely) it is easily fixed.

Colin

 

<snip>

Have you tried this yet?

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Brian Orpin

unread,
Oct 24, 2016, 1:10:55 PM10/24/16
to Node-RED

On Monday, 24 October 2016 17:35:07 UTC+1, Colin Law wrote:
On 24 October 2016 at 15:57, Brian Orpin <brian...@gmail.com> wrote:
Hi Colin,  I'd rather not break the working system unless I have to :(

I presume that comment means that you have not recently made an image dump of your SD card.  Take a fresh image dump before you try it.  Then if catastrophe ensues (unlikely) it is easily fixed.

No the SD Card is only a 256mb card for the kernel.  The main system boots and runs off a USB HDD with data backed up elsewhere. I could rebuild it but really it isn't broken, just cannot work out what is starting node-red :)

Julian Knight

unread,
Oct 24, 2016, 2:23:25 PM10/24/16
to Node-RED
OK, so you are certainly running an apt-get installed version of NR & Node.js

This article may help with understanding the magic behind systemd: https://www.turnkeylinux.org/blog/debugging-systemd-sysv-init-compat
and how to debug where the actual script is!

Good hunting :-)

Colin Law

unread,
Oct 24, 2016, 4:55:12 PM10/24/16
to node...@googlegroups.com
I think the problem is that systemd shows it as not running, but in fact it is running.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
0 new messages