First of all, please, read until the end of the story and believe me that this is not a duplicate question - I've read all the possibilities and all the variations of this kind of issue but I didn't found a fix until now.
Second of all - let me tell you about my issue: I have a Raspberry PI 3 updated and upgraded, I have a node.js app (v 4.3.2) which if it's run from the command line when the user is logged in, it runs perfectly but if I'm scheduling the app to be run on startup it doesn't do anything. I mean, the app is running:
492 ? S 0:00 sudo nohup node /home/pi/meteo/meteo.js 527 ? Sl 0:01 node /home/pi/meteo/meteo.js
but it doesn't do anything.
In order to make it to run at startup I used the crontab way of scheduling like this:
@reboot sudo nohup node /home/pi/meteo/meteo.js &> /home/pi/meteo/meteo-reboot.log &
and accordingly to the processes that are running after startup, the application is working but, as I've said, it doesn't do anything.
Few words about the app: it's a simple app which connects to a Bluetooth sensor (TI CC2650) and sends the data to the IoT Hub on Azure. The app doesn't expect any input from the user.
Is there any place where can I see any node.js logging or is there any way of tracing what it might be the issue because I suspect that something might not be initialized when the app starts after reboot.
As you see in my crontab command, I'm sending all the output to a file - if I run that command manually, the meteo-reboot.log file is filled with my app output but if the app is running after startup using the crontab scheduling system, that file is empty and it doesn't get any data in it.
Thank you for your time and hopefully that there is someone who knows how can I get some info about what is wrong.