ASM #465 - Update capture script to prevent hanging when running psql

Change-Id: I74c9fe349509850522a8bee37f34664559435d3c

Former-commit-id: 17ab69323dd1b420662db25e09b05e3408d3f2ab
This commit is contained in:
Brian.Dyke 2014-04-11 11:13:00 -04:00
parent a8d6d58f31
commit deff8ed340

View file

@ -184,6 +184,7 @@ grabCurrentDatabaseQueries() {
t1=`date "+%Y%m%d %H:%M:%S"`
echo "${t1}: Capturing current database queries" >> $processFile
out_file="${dataPath}/database_queries.log"
echo "dx1f:5432:metadata:awips:awips" > ~/.pgpass; chmod 600 ~/.pgpass
psql -d metadata -U awips -h ${DATABASE_HOST} -c "select datname, pid, client_addr, query, now()-xact_start as runningTime from pg_stat_activity where state != 'idle' order by runningTime desc;" >> $out_file 2>&1 &
fi
}
@ -671,6 +672,7 @@ fi
zenity --info --no-wrap --title="Capture Done" --text="$message" > /dev/null 2>&1 &
echo
echo $message
rm ~/.pgpass
cd $curDir