#!/bin/sh
exec node /opt/nodejs/first/app.js 1>>/opt/nodejs/first/log/output 2>>/opt/nodejs/first/log/error
This shell script throws an error:
exec: 2: node: not found
I’m trying to launch it on system boot:
sudo update-rc.d autostart.sh defaults 95
I’m doing something wrong?
Maybe boot level is wrong or order number, or something else?
Thanks 😉
You need to set your
PATHenvironment variable to include the directory where yournodebinary lives. For starting on boot, what OS are you running? I suggest Ubuntu where you can use the upstart system. Here’s a simple upstart script to make a node server work as a daemon.