Postgres for Jasper is not shutting down cleanly or quickly

book

Article ID: 130249

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

Postgres does not shutdown cleanly or quickly.
Message indicates:

pg_ctl: server does not shut down

<Please see attached file for image>

User-added image

Cause

The script times out waiting for the server to actually shutdown.

Environment

Release:
Component: SPCCSS

Resolution

This section of the stopservers.sh script: 
 
This section of the stopservers.sh script: 

# This method starts postgres 
function stopPostgres 
{ 
echo "Default Postgres database user is: "$postgreSqlUser 
echo "Default Postgres database port is: "$postgresPort 
checkPortRunning $postgresPort 
portReturn=$? 

if [ "$portReturn" -eq "0" ] 
then 
return 2 
else 
su $postgreSqlUser -c "postgresql/bin/pg_ctl -D postgresql/data -l postgresql/logs/log.txt stop" 
waitForPortToClose "$postgresPort" 180 
#echo "Postgres"$? 
pportreturn=$? 
#echo "Got "$pportreturn" from wait" 
if [ "$pportreturn" -eq "1" ] 
then 
return 0 
else 
return 1 
fi 
fi 

} 





Change this line: 
 
"su $postgreSqlUser -c "postgresql/bin/pg_ctl -D postgresql/data -l postgresql/logs/log.txt stop"


To: 
 
"su $postgreSqlUser -c "postgresql/bin/pg_ctl -D postgresql/data -l postgresql/logs/log.txt stop -m fast"

The script should now shutdown quicker and successfully.
 

Attachments

1558688178782000130249_sktwi1f5rjvs16fij.jpeg get_app