Timeline for Run node server on boot
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 4, 2015 at 15:38 | vote | accept | Watchmaker | ||
Jun 4, 2015 at 15:38 | comment | added | Watchmaker | As @goldilocks and Phil_B remarked at boot time the $PATH variable hasn't been set yet. In the end I hardcoded the $NODE_EXEC variable to my node installation path. | |
Jun 4, 2015 at 14:35 | comment | added | Phil B. |
The point here is: $PATH is not set to include your local path by the time init runs the script, so you cannot rely on which node to find node. You need to either put node in a directory that is in a default available path (/opt/bin perhaps?) or explicitly put the path to node in your script.
|
|
Jun 4, 2015 at 13:41 | comment | added | goldilocks♦ |
It's not in $PATH when that script is run by init, unless you've specifically configured the system to put it there. Again, these are things you could check very simply by just logging the values to a file to confirm they are what you think they are. This is basic debugging 101. If you can't be bothered to do that, there is no help anyone can give you.
|
|
Jun 4, 2015 at 13:37 | comment | added | Watchmaker |
Of course /home/pi/my-node-dir/bin is in my $PATH, otherwise it wouldn't run from the cli. And it is in the $PATH for pi user and root user as well. $ which node produces /home/pi/my-node-dir/bin/node
|
|
Jun 4, 2015 at 13:28 | history | answered | goldilocks♦ | CC BY-SA 3.0 |