Manish Sapkal
Manish Sapkal

Reputation: 6191

why node.js process is killed?

I have developed one app in node.js. Recently I noticed when I am doing any changes in my "public" directory of my application, one error is recorded in my log file as follows:

error: restarting script because /home/{user}/workspace/{app_folder}/img/{filename}.jpg changed.
error: Forever detected script was killed by signal: SIGKILL
error: Forever restarting script for 1 time
Express server listening on port 3000

I have already set --watchIgnore parameter in my forever script file in /etc/init/{app}.config

env IGNORE_DIRECTORY="/home/{user}/workspace/{app_folder}/img/**"

exec forever --sourceDir $APPLICATION_DIRECTORY --watchIgnore $IGNORE_DIRECTORY \
      -a -w -l $LOG --minUptime 5000 --spinSleepTime 2000 \
start $APPLICATION_START

What am I missing?

Upvotes: 3

Views: 1958

Answers (1)

msanford
msanford

Reputation: 12227

Note that the log shows {user} and not your actual user directory. This path looks like it was copied from a user guide, where you were meant to replace those quasi-variables with something.

You use bash environment variables (I assume you're using bash) like this:

env IGNORE_DIRECTORY="~/workspace/${APPLICATION_DIRECTORY}/img/**"

It looks like app_folder is actually defined for you as APPLICATION_DIRECTORY. You can also use ~/ as a shortcut for the current user's home folder.

Upvotes: 2

Related Questions