<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic postgresql does not start in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112965#M31448</link>
    <description>&lt;P&gt;My Postgresql does not start. Help me my command was as below&lt;/P&gt;&lt;P&gt;[root@erms /]# /d02/postgresql/scripts/ctl.sh start&lt;BR /&gt;waiting for server to start.... stopped waiting&lt;BR /&gt;pg_ctl.bin: could not start server&lt;BR /&gt;Examine the log output.&lt;BR /&gt;/d02/postgresql/scripts/ctl.sh : postgresql could not be started&lt;BR /&gt;[root@erms /]#&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 13:22:52 GMT</pubDate>
    <dc:creator>resegok</dc:creator>
    <dc:date>2019-11-13T13:22:52Z</dc:date>
    <item>
      <title>postgresql does not start</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112965#M31448</link>
      <description>&lt;P&gt;My Postgresql does not start. Help me my command was as below&lt;/P&gt;&lt;P&gt;[root@erms /]# /d02/postgresql/scripts/ctl.sh start&lt;BR /&gt;waiting for server to start.... stopped waiting&lt;BR /&gt;pg_ctl.bin: could not start server&lt;BR /&gt;Examine the log output.&lt;BR /&gt;/d02/postgresql/scripts/ctl.sh : postgresql could not be started&lt;BR /&gt;[root@erms /]#&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:22:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112965#M31448</guid>
      <dc:creator>resegok</dc:creator>
      <dc:date>2019-11-13T13:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: postgresql does not start</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112966#M31449</link>
      <description>&lt;PRE&gt;#!/bin/sh

HOSTNAME=`hostname`
POSTGRESQL_PIDFILE=/d02/alf_data/postgresql/postmaster.pid

POSTGRESQL_START="/d02/postgresql/bin/pg_ctl start -w -D /d02/alf_data/postgresql"
POSTGRESQL_STOP="/d02/postgresql/bin/pg_ctl stop -D /d02/alf_data/postgresql"

PGPORT=5430
POSTGRESQL_STATUS=""
POSTGRESQL_PID=""
PID=""
ERROR=0

get_pid() {
    PID=""
    PIDFILE=$1
    # check for pidfile
    if [ -f "$PIDFILE" ] ; then
        PID=`head -1 $PIDFILE`
    fi
}

get_postgresql_pid() {
    get_pid $POSTGRESQL_PIDFILE
    if [ ! "$PID" ]; then
        return
    fi
    if [ "$PID" -gt 0 ]; then
        POSTGRESQL_PID=$PID
    fi
}

is_service_running() {
    PID=$1
    if [ "x$PID" != "x" ] &amp;amp;&amp;amp; kill -0 $PID 2&amp;gt;/dev/null ; then
        RUNNING=1
    else
        RUNNING=0
    fi
    return $RUNNING
}

is_postgresql_running() {
    get_postgresql_pid
    is_service_running $POSTGRESQL_PID
    RUNNING=$?
    if [ $RUNNING -eq 0 ]; then
        POSTGRESQL_STATUS="postgresql not running"
    else
        POSTGRESQL_STATUS="postgresql already running"
    fi
    return $RUNNING
}

start_postgresql() {
    is_postgresql_running
    RUNNING=$?
    if [ $RUNNING -eq 1 ]; then
        echo "$0 $ARG: postgresql  (pid $POSTGRESQL_PID) already running"
	exit
    fi
    if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ]; then
	su postgres -c "$POSTGRESQL_START"
    else
	$POSTGRESQL_START 
    fi
    sleep 3
    is_postgresql_running
    RUNNING=$?
    if [ $RUNNING -eq 0 ]; then
        ERROR=1
    fi
    if [ $ERROR -eq 0 ]; then
	echo "$0 $ARG: postgresql  started at port 5430"
	sleep 2
    else
	echo "$0 $ARG: postgresql  could not be started"
	ERROR=3
    fi
}

stop_postgresql() {
    NO_EXIT_ON_ERROR=$1
    is_postgresql_running
    RUNNING=$?
    if [ $RUNNING -eq 0 ]; then
        echo "$0 $ARG: $POSTGRESQL_STATUS"
        if [ "x$NO_EXIT_ON_ERROR" != "xno_exit" ]; then
            exit
        else
            return
        fi
    fi
    if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ]; then
        su postgres -c "$POSTGRESQL_STOP"
    else
        $POSTGRESQL_STOP
    fi
    sleep 5

    is_postgresql_running
    RUNNING=$?
    if [ $RUNNING -eq 0 ]; then
            echo "$0 $ARG: postgresql stopped"
        else
            echo "$0 $ARG: postgresql could not be stopped. Trying to perform a \"fast\" shutdown."
            if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ]; then
                su postgres -c "$POSTGRESQL_STOP -m fast"
            else
                $POSTGRESQL_STOP -m fast
            fi
            sleep 5

            is_postgresql_running
            RUNNING=$?
            if [ $RUNNING -eq 0 ]; then
                    echo "$0 $ARG: postgresql stopped"
                else
                    echo "$0 $ARG: postgresql could not be stopped."
                    ERROR=4
            fi
    fi
}

cleanpid() {
    rm -f $POSTGRESQL_PIDFILE
}

if [ "x$1" = "xstart" ]; then
    start_postgresql
elif [ "x$1" = "xstop" ]; then
    stop_postgresql
elif [ "x$1" = "xstatus" ]; then
    is_postgresql_running
    echo "$POSTGRESQL_STATUS"
elif [ "x$1" = "xcleanpid" ]; then
    cleanpid
fi

exit $ERROR&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:37:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112966#M31449</guid>
      <dc:creator>resegok</dc:creator>
      <dc:date>2019-11-13T13:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: postgresql does not start</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112967#M31450</link>
      <description>&lt;P&gt;Caused by: org.postgresql.util.PSQLException: Connection to localhost:5430 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.&lt;BR /&gt;at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:262)&lt;BR /&gt;at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:52)&lt;BR /&gt;at org.postgresql.jdbc.PgConnection.&amp;lt;init&amp;gt;(PgConnection.java:216)&lt;BR /&gt;at org.postgresql.Driver.makeConnection(Driver.java:404)&lt;BR /&gt;at org.postgresql.Driver.connect(Driver.java:272)&lt;BR /&gt;at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)&lt;BR /&gt;at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)&lt;BR /&gt;at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)&lt;BR /&gt;at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)&lt;BR /&gt;at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)&lt;BR /&gt;at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:83)&lt;BR /&gt;at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:49:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/postgresql-does-not-start/m-p/112967#M31450</guid>
      <dc:creator>resegok</dc:creator>
      <dc:date>2019-11-13T13:49:50Z</dc:date>
    </item>
  </channel>
</rss>

