Skip to content

Commit

Permalink
Fix: Remove Start.log Req. From startup script
Browse files Browse the repository at this point in the history
Fix for Remove Start.log Requirement From Passport Startup.
  • Loading branch information
ganesh-at-wiw authored Dec 5, 2018
1 parent 8583be7 commit 6818362
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions static/system/initd/passport
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,13 @@ fi
NODE_INIT_LOG="$NODE_LOGS/`ls -1rt $NODE_LOGS|tail -n 1`"
dip_in_logs() {
echo "Checking logs for possible errors:"
if [ ! -f $NODE_INIT_LOG ]; then
NODE_INIT_LOG="$NODE_LOGS/start.log"
fi
if [ ! -f $NODE_INIT_LOG ]; then
TODAY=`date +%Y-%m-%d`
NODE_INIT_LOG="$NODE_LOGS/passport-${TODAY}.log"
touch "$NODE_INIT_LOG"
chown node:node $NODE_INIT_LOG
fi

INIT_START_STATUS=`tail -n 1 $NODE_INIT_LOG`
while true;
do
Expand Down Expand Up @@ -455,7 +459,8 @@ do_start () {
CH_USER="-c$NODE_USER"
fi
start-stop-daemon -S -p"$NODE_PID_FILE" $CH_USER -d"$NODE_BASE" -b -m -a "/bin/bash" -- -c "exec /usr/bin/env ${NODE_OPTIONS[*]} $NODE ${RUN_ARGS[*]} start-log-file=$NODE_LOGS/start.log >> $NODE_LOGS/start.log 2>&1"


sleep 2
dip_in_logs
START_STATUS=`tail -n 10 $NODE_INIT_LOG|grep -i 'Server listening on'`
ERROR_STATUS=`tail -n 10 $NODE_INIT_LOG|egrep -i "[ERROR] Error in starting the server|[Error]"`
Expand Down

0 comments on commit 6818362

Please sign in to comment.