Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 302
Manish Sapkal Avatar asked Jun 11 '26 10:06

Manish Sapkal


1 Answers

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.

like image 173
msanford Avatar answered Jun 13 '26 00:06

msanford



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!