Answer the question
In order to leave comments, you need to log in
Why is Upstart not running node js?
Good afternoon.
There was a problem setting up a file under node js to run in the background. The problem is that when the process starts, the system writes that it has started it, but in fact it just stops it.
The contents of the node.conf file
description "node.js server"
author "rdbn"
env NODE_BIN=/usr/local/bin/node
env APP_DIR=/home/rdbn/game
env SCRIPT_FILE="app.js" # Entry point for the nodejs app
env LOG_FILE=/var/log/node.sys.log
env RUN_AS="rdbn"
start on filesystem or runlevel [2345]
stop on [!2345]
#start on (local-filesystems and net-device-up IFACE=eth0)
#stop on shutdown
script
touch $LOG_FILE
chown $RUN_AS:$RUN_AS $LOG_FILE
chdir $APP_DIR
exec sudo -u $RUN_AS sh -c " $NODE_BIN $SCRIPT_FILE >> $LOG_FILE 2>&1"
end script
pre-start script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> $LOG_FILE
end script
pre-stop script
echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> $LOG_FILE
end script
respawn
respawn limit 5 30
sudo start node
node start/running, process 2015
sudo stop node
stop: Unknown instance:
sudo status node
node stop/waiting
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question