Jasper Server Postgres service fails to stop using the stopServers script

Document ID : KB000098345
Last Modified Date : 29/05/2018
Show Technical Document Details
Issue:
After running the <JASPERHOME>/stopServers script, the Postgres server fails to stop and you may see the following output:

Default Postgres database user is: postgres
Default Postgres database port is: 5432
waiting for server to shut down............................................................... failed
pg_ctl: server does not shut down
HINT: The "-m fast" option immediately disconnects sessions rather than waiting for session-initiated disconnection.
Unable to stop Default Postgres database
Environment:

CA Business Intelligence JasperReportsĀ® Server - 6.3.0
CA Business Intelligence JasperReportsĀ® Server - 6.4.2

Cause:
The issue is that the Postgres server is timing out which is causing the script to fail.
Resolution:
Navigate to the <JASPERHOME>/stopServers script, open the file and look for the following section:

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

and change it to:

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


Save the file, then re-run the script in order to successfully shutdown the Postgres server.
Ā