-
Notifications
You must be signed in to change notification settings - Fork 86
Description
I made a node server, using pi + node + express + pi-gpio . And I also use FOREVER to run the server forever.
It work well when I run it as "node app.js" or "forever start app.js". The pi-gpio can work conrectly and GPIO can work too.
but , if I add the FOREVER command to a /etc/init.d/ service, for example, /etc/init.d/nodepi, it won't work well. It said "GPIO admin can't find".
the /etc/init.d/nodepi's content like this:
forever start node app.js
After running the /etc/init.d/nodepi, the webserver has started and I can visit it. But the GPIO of PI couldn't work.
Weirdly, If I run another command after this, "PORT=1234 node app.js" , I can visit the website by PORT 1234. And then, The GPIO works!. When I return to visit PORT 3000 website (the app.js default port) I can control the GPIO. It's working!
I think there might be some problem on user's rights.
All those operations are ran by root.