ASM #465 - Update capture script to prevent hanging when running psql
Change-Id: I74c9fe349509850522a8bee37f34664559435d3c Former-commit-id: 17ab69323dd1b420662db25e09b05e3408d3f2ab
This commit is contained in:
parent
6575f77fe3
commit
192a5513df
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue