I can run my /etc/rc.local file manually, it runs on startup (echoing a string to a file), but the forever (npm package) is failing for some reason. I'm running the Amazon Linux AMI on an EC2 instance if that helps.
Where can I look to understand why it's failing or can you tell me what I'm doing wrong?
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
echo "rc.local is running..." > /tmp/rc.local-output
touch /var/lock/subsys/local
exec /usr/local/bin/forever start -c /usr/local/bin/node /var/www/node/myapp/app.js &
exec /usr/local/bin/forever start -c /usr/local/bin/node /var/www/node/myapp/tools/push/push_service.js &
Ok, things seems to be getting a bit better, I updated my rc.local file to this:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
exec 2> /tmp/rc.local.log # send stderr from rc.local to a log file
exec 1>&2 # send stdout to the same log file
set -x # tell sh to display commands before execution
echo "rc.local is running..." >> /tmp/rc.local-output
touch /var/lock/subsys/local
/usr/local/bin/forever start /var/www/node/myapp/app.js &
/usr/local/bin/forever start /var/www/node/myapp/tools/push/push_service.js &
And /tmp/rc.local.log is telling me this:
/usr/bin/env: node: No such file or directory