node-startup icon indicating copy to clipboard operation
node-startup copied to clipboard

PID recorded on AWS EC2 at startup was wrong.

Open funmu opened this issue 9 years ago • 3 comments

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?

funmu avatar Feb 05 '16 18:02 funmu

looks like $! isn't being set properly.

ralyodio avatar Feb 05 '16 20:02 ralyodio

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 avatar Feb 05 '16 20:02 funmu

@funmu It's been fixed

FossPrime avatar Jun 26 '18 13:06 FossPrime