DietPi installation lacks basic commands

Hi,

I am just getting into Node-RED. All the documentation I find discusses the 3 commands:

Node-red-start
Node-red-stop
Node-red-log

But the DietPi installation of Node-RED only provides the command Node-red

Incidentally, I am also running on an Pine64, if that makes a difference.

Has anybody any ideas why this should be so?

Thanks!

Brian

the default DietPi install does not install those extra commands, so they are not available.

If you use our upgrade script for Pi - it should fail to upgrade and tell you to use their update mechanism, but it will as a bonus add the commands for you... Alternatively the commands used to generate them can be run manually

    echo "journalctl -f -n 25 -u node-red -o cat" > /usr/bin/node-red-log
    chmod +x /usr/bin/node-red-log
    echo "dietpi-services stop node-red" > /usr/bin/node-red-stop
    chmod +x /usr/bin/node-red-stop
    echo "dietpi-services start node-red" > /usr/bin/node-red-start
    echo "journalctl -f -n 0 -u node-red -o cat" >> /usr/bin/node-red-start
    chmod +x /usr/bin/node-red-start

Note: they are not 100% identical in that they are are calling the dietpi-services command but hopefully are close enough.

1 Like

@dceejay

The weird thing is even though, I can see node-red-stop and node-red-start at /usr/bin, still getting the following error:
/usr/bin/node-red-stop: line 1: dietpi-services: command not found
If I run as root:
/usr/bin/node-red-stop: 1: dietpi-services: not found

That is saying that a command used inside node-red-stop is not found. Not that node-red-stop itself is not found. Have a look at the start of the node-red-stop script.

Yes, I am aware of that, that is why I found it weird.

Inside of node-red-stop, there is dietpi-services stop node-red as expected from @dceejay answer.

dietpi-services stop node-red runs pretty fine, if I run it via terminal.

Strange. Does it help if you use the full path to dietpi-services in the script. So possibly
/usr/bin/dietpi-services stop node-red
You can find where it is by using which dietpi-services

/usr/bin/dietpi-services does not exit. which dietpi-services returns nothing.

However, I have seen the following when I have checked their forum.:

In general dietpi-services is just a frontend for systemctl that we use to start/stop/restart all known/added services on boot, before and after software installs, updates and such, in an order that respects cross-access, e.g. webserver accessing PHP-FPM, or PHP accessing database via module and such.

Hence, I changed the dietpi-services to systemctl. Now, it works as expected.

It must be just an alias rather than a script, which would explain why it could not be found in by the script.

Thanks for digging into this - just to confirm - you changed the script to be systemctl stop node-red and that now works ?

Hi @dceejay,

Yes, exactly.

Thanks. I’ll update the script to set it like that instead