Skip to content

Commit

Permalink
Moved some echoes
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpgall committed Aug 28, 2014
1 parent c96df68 commit e4b6386
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions init.d/node-app
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/sh

NODE_ENV="production"
NODE_APP="app.js"
PORT=3000
CONFIG_DIR="$APP_DIR"
APP_DIR="/var/www/example.com"
NODE_APP="app.js"
PID_DIR="$APP_DIR/pid"
PID_FILE="$PID_DIR/app.pid"
LOG_DIR="$APP_DIR/log"
LOG_FILE="$LOG_DIR/app.log"
CONFIG_DIR="$APP_DIR"
PORT=3000
NODE_EXEC=$(which node)

###############
Expand Down Expand Up @@ -57,10 +57,12 @@ start_it() {

stop_process() {
PID=$(get_pid)
echo "Killing process $PID"
kill $PID
}

remove_pid_file() {
echo "Removing pid file"
rm -f "$PID_FILE"
}

Expand All @@ -77,7 +79,6 @@ start_app() {
if [ $FORCE_OP = true ]
then
echo "Forcing start anyways"
echo "Removing pid file"
remove_pid_file
start_it
fi
Expand All @@ -93,17 +94,14 @@ stop_app() {
if is_running
then
echo "Stopping node app ..."
echo "Killing process $(get_pid)"
stop_process
echo "Removing pid file"
remove_pid_file
echo "Node app stopped"
else
echo "Node app already stopped, but pid file exists"
if [ $FORCE_OP = true ]
then
echo "Forcing stop anyways ..."
echo "Removing pid file"
remove_pid_file
echo "Node app stopped"
else
Expand All @@ -121,7 +119,8 @@ status_app() {
then
if is_running
then
echo "Node app running with pid $(get_pid)"
PID=$(get_pid)
echo "Node app running with pid $PID"
else
echo "Node app stopped, but pid file exists"
fi
Expand Down

0 comments on commit e4b6386

Please sign in to comment.