wait signal

This commit is contained in:
tknew2 2014-01-10 17:20:20 +01:00
parent fa38e05331
commit b0d4ef8dfd

View File

@ -69,6 +69,7 @@ cat /dev/null > $OUT_LOG
$pm2 sendSignal SIGUSR2 signal.js
sleep 1
OUT=`grep "SIGUSR2" "$OUT_LOG" | wc -l`
[ $OUT -eq 2 ] || fail "Signal not received by the process name"
success "Processes sucessfully receives the signal"
@ -77,6 +78,8 @@ $pm2 stop signal.js
# Send a process by id
$pm2 start signal.js
sleep 1
# get the log file and the id.
OUT_LOG=`$pm2 prettylist | grep -m 1 -E "pm_out_log_path:" | sed "s/.*'\([^']*\)',/\1/"`
ID=`$pm2 prettylist | grep -E "pm_id:" | sed "s/.*pm_id: \([^,]*\),/\1/"`