Open Jarvis785 opened 8 years ago
Can you check the log file related to this service in /var/log and see if it has got console logs from your service?
Found the error sir !! Its showing can not find module blynk-library... (I hv included this library in node program)
But running the same file using node x.js works ...
But why in forever service it is unable to fetch the library ??
is it due to the problem that the process can't acess global library
When provisioning the service i will usually advise to change the directory to the directory of the script and than provision the service, since this way when service is run it runs from same directory.
So i would suggest you do the following.
cd /home/pi/
sudo forever-service install IOT --script blink.js
no sir .. doing cd /home/pi/ sudo forever-service install IOT --script blink.js
gave the same result !!
In that case i cant exactly be more helpful on the issue, sometimes issue could be related to path / nodejs installation folder since services run under sudo context, and may not have exact environment (as running them normally from terminal) when you run them as sudo under service context.
So i guess you will have to do more debugging, since only thing forever-service does is invokes forever for your script. Beyond that it has no control on what goes on.
No idea, but why don't you give it a shot.
i had deleted that IOT.log .... now installing and running IOT again ... i can't found the log file again !!
i had a simple LED blink code nodejs i have tested by command :node /home/pi/blink.js (its blinking !! working..)
sudo forever-service install IOT --script /home/pi/blink.js
sudo service IOT start (it gives no error) sudo service IOT status (it says running) IOT.service - LSB: forever-service startup script for IOT Loaded: loaded (/etc/init.d/IOT) Active: active (running) since Sat 2016-10-29 20:17:00 UTC; 1min 46s ago Process: 4217 ExecStart=/etc/init.d/IOT start (code=exited, status=0/SUCCESS) CGroup: /system.slice/IOT.service └─2835 /usr/bin/nodejs /usr/lib/node_modules/forever/bin/monitor /home/pi/myblynk.js
Oct 29 20:17:00 Pi-Jarvis IOT[4217]: Service IOT already running Oct 29 20:17:00 Pi-Jarvis systemd[1]: Started LSB: forever-service startup script for IOT.
But LED not blinking !! Why ?
ame program works if i use only forever :: forever /home/pi/blink.js start !!
but forever-service not working