PID recorded on AWS EC2 at startup was wrong.
One more issue: the PID recorded for the node-startup app is pointing to the bash shell used to start the script instead of referencing the node app that is actually running.
why would this happen? And how can I fix it?
looks like $! isn't being set properly.
here is the line of code that is doing it.
is there a race condition of sorts between when the $! is fetched and when the node process is launched?
echo "cd $APP_DIR && PORT=$PORT NODE_ENV=$NODE_ENV NODE_CONFIG_DIR=$CONFIG_DIR $NODE_EXEC $APP_DIR/$NODE_APP 1>$LOG_FILE 2>&1 & *echo $! *> $PID_FILE" | sudo -i -u $USER
On Fri, Feb 5, 2016 at 12:32 PM, Anthony Ettinger [email protected] wrote:
looks like $! isn't being set properly.
— Reply to this email directly or view it on GitHub https://github.com/chovy/node-startup/issues/30#issuecomment-180545614.
@funmu It's been fixed