I'm working on a Raspberry Pi running nextjs (node server) connected with nginx. I tried using x-terminal-emulator ‘/usr/bin/bash -c /home/pi/Desktop/startup.sh’
but many of them didn’t recognize /usr/bin/bash
as a directory and most of them didn’t budge to execute the script. In how many ways can I start my bash script? What is the most useful way possible?
These are the ways that I tried and the errors corresponding to them.
/usr/bin/bash
file or directory doesn’t exist.I’ve must of been using them incorrectly. If so what is the way to use them?
This recipe allows you to launch node server at system boot. In this recipe it is assumed that you have a node server running on port 3000.
Steps
sudo nano /etc/rc.local
Add the following line to the rc.local file
sudo node /home/pi/node_server.js
sudo chmod +x /etc/rc.local
sudo reboot
sudo netstat –lntp | grep 3000
This should output node server which is running on port 3000.
curl -i http://<ip_address>:3000