I am running a raspberry pi B+ with the intentions of running a node js app on boot.
I am using the command
su pi -c 'node /home/pi/bartender_main/app.js < /dev/null &' in my /etc/rc.local file. When it boots up it act like it work and give me my indication that it is ready, but shortly is says board closing and it quits the app. Does anyone have any ideas. Thanks
Best How To :
Board Closing message is printed when the Johnny-Five repl reaches the end of its standard input or its process receives a SIGINT.
/dev/null to stdin causes that end of input, so this is likely what is happening. (Also, init scripts are more likely to be killed by SIGTERM or SIGHUP.) Without seeing the internals of
app.js, it is hard to say what it is trying to do, but it is probably something like this. You could keep it alive past the initial launch by not ending stdin:
su pi -c 'node /home/pi/bartender_main/app.js'