node-cbus server.js run on boot
I have everything working great. every time i close the SSH session the server.js stops working i would just like to get the server.js to run on boot on my raspberry pi I have tried lots of different ways but i cant figure it out any help would be appreciated
I just use PM2 and it keeps it open in the background
Thanks mate
Paul Glassenbury Tech Energy
Business Development Manager
12 Susan Street Hindmarsh South Australia 5007 P. 08 8340 9255 M. 0468 987 499
If you are not the intended recipient, please notify the sender and delete the message. Middendorp Electric Co Pty Ltd | ACN 004 798 270 | ABN 49 338 705 390 Please consider the environment before printing this email. This email is private and confidential.
From: NovaGL [mailto:[email protected]] Sent: Friday, October 13, 2017 1:37 PM To: anthonywebb/node-cbus [email protected] Cc: Chickenparmie [email protected]; Author [email protected] Subject: Re: [anthonywebb/node-cbus] node-cbus server.js run on boot (#5)
I just use PM2 and it keeps it open in the background
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthonywebb/node-cbus/issues/5#issuecomment-336337864 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXQmAJj3LnD1zzTdsJJ_pUtfT0a2AK9Vks5srtPJgaJpZM4PPUvB . https://github.com/notifications/beacon/AXQmACwObjZYSD1Kf52CUcwwUu63NNBmks5srtPJgaJpZM4PPUvB.gif
Add this path to your /etc/rc.local file by doing 'sudo /etc/rc.local' and add the following line
su pi -c 'node [PATH/TO/SERVER.JS] < /dev/null &'
but replace with your path. For example, if your js file is in the default home pi directory your line would be
su pi -c 'node /home/pi/node-cbus/server.js < /dev/null &'