I started an Amazon Linux instance via AWS EC2. I'm trying to write an upstart script that will start my node server when the instance starts up.
If I run npm start
in the terminal, my node server starts successfully. I'm using the following upstart script, but it doesn't start my server.
# Upstart Script for My Server
description "my-server"
start on started mountall
stop on shutdown
# Automatically Respawn
respawn
respawn limit 99 5
# Environment Variables
env NODE_ENV=development
# Script to Start Server
script
cd /home/ec2-user/my-server
exec /usr/bin/npm start >> /var/log/my-server.log 2>&1
end script
Checking the /var/log/my-server.log
file tells me /user/bin/npm: No such file or directory
.