My machine is Ubuntu 16.04. I want to start my node.js application when the machine boots up everytime. According to this post about autostarting services. I tried to make a service by doing the following:
1) I created a script to start node app with node's forever
module.
#!/bin/bash
echo "Starting App"
forever -a start /opt/app/app.js
echo "App started"
2) I named this script startApp.sh
and put this script inside /etc/init.d/ folder.
3) I ran the command update-rc.d startApp defaults
But I got the error update-rc.d: error: initscript does not exist: /etc/init.d/startApp
What did I do wrong?