Issue #2182 - PostgreSQL port is now configurable in postgresql.conf; Java path is no longer relative in wrapper.conf

Amend: wrap file access in try..finally; move StringBuilder outside of a loop

Change-Id: Iafa7493ef79a0a891f36923f1695cefdb47e16da

Former-commit-id: 43008f4698 [formerly 43008f4698 [formerly 71f74d7b8125994537ef5520fe59134a7f86e9af]]
Former-commit-id: 120ebd045a
Former-commit-id: fac9d72cc8
This commit is contained in:
Bryan Kowal 2013-12-12 10:32:22 -06:00
parent fcd5955a0f
commit 9e0e6662c8
12 changed files with 643 additions and 563 deletions

View file

@ -4,6 +4,7 @@
<property name="src" value="src"></property>
<property name="db.mach.name" value="localhost"/>
<property name="database" value="hd_ob83krf" />
<property name="database.port" value="5432" />
<target name="runJDbGen">
@ -12,7 +13,7 @@
<pathelement location="./bin"/>
<pathelement path="${basedir}/REQUIRED_JARS/postgresql-8.3-603.jdbc3.jar"/>
</classpath>
<arg value="jdbc:postgresql://${db.mach.name}:5432/${database}?user=awips"/> <!-- connectionURL -->
<arg value="jdbc:postgresql://${db.mach.name}:${database.port}/${database}?user=awips"/> <!-- connectionURL -->
<arg value="${basedir}/PreferredTableNames.txt"/> <!--preferredTableNameFilePath -->
<arg value="${database}"/> <!-- dbName -->
<arg value="ohd.hseb.ihfsdb.generated"/> <!-- packageName -->

View file

@ -34,7 +34,7 @@ wrapper.fork_hack=true
wrapper.console.pipestreams=true
# Java Application
wrapper.java.command=${EDEX_HOME}/../java/bin/java
wrapper.java.command=${JAVA_HOME}/bin/java
# necessary for etc/init.d/edex_camel
wrapper.pidfile=${EDEX_HOME}/bin/${EDEX_RUN_MODE}.pid

View file

@ -3,6 +3,7 @@
<property name="dist" value="dist" />
<property name="src" value="src" />
<property name="db.mach.name" value="localhost" />
<property name="db.port" value="5432" />
<property name="database" value="hd_ob83oax" />
<target name="runJDbGen" depends="prepare">
@ -12,7 +13,7 @@
<pathelement location="./classes"/>
<pathelement path="${basedir}/REQUIRED_JARS/postgresql-8.3-603.jdbc3.jar"/>
</classpath>
<arg value="jdbc:postgresql://${db.mach.name}:5432/${database}?user=awips"/> <!-- connectionURL -->
<arg value="jdbc:postgresql://${db.mach.name}:${db.port}/${database}?user=awips"/> <!-- connectionURL -->
<arg value="${basedir}/PreferredTableNames.txt"/> <!--preferredTableNameFilePath -->
<arg value="${database}"/> <!-- dbName -->
<arg value="ohd.hseb.ihfsdb.generated"/> <!-- packageName -->

View file

@ -60,7 +60,7 @@ listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
port = 5432 # (change requires restart)
max_connections = 300 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).

View file

@ -60,7 +60,7 @@ listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
port = 5432 # (change requires restart)
max_connections = 300 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).

View file

@ -7,7 +7,7 @@
Summary: Pypies Apache HTTP Server
Name: awips2-httpd-pypies
Version: 2.2.15
Release: 15.3.el6
Release: 15.3-1.el6
URL: http://httpd.apache.org/
Source0: http://archive.apache.org/dist/httpd/httpd-%{version}.tar.gz
Source1: index.html

View file

@ -100,7 +100,9 @@ start() {
stop() {
echo -n $"Stopping $prog: "
/awips2/httpd_pypies/usr/sbin/apachectl -k graceful-stop
${HTTPD_PYPIES_INSTALL}/usr/sbin/apachectl -f \
${HTTPD_PYPIES_INSTALL}/etc/httpd/conf/httpd.conf \
-k graceful-stop
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
@ -148,7 +150,9 @@ reload() {
echo $"not reloading due to configuration syntax error"
failure $"not reloading $httpd due to configuration syntax error"
else
/awips2/httpd_pypies/usr/sbin/apachectl -k graceful
${HTTPD_PYPIES_INSTALL}/usr/sbin/apachectl -f \
${HTTPD_PYPIES_INSTALL}/etc/httpd/conf/httpd.conf \
-k graceful
RETVAL=$?
fi
echo
@ -191,4 +195,4 @@ case "$1" in
exit 1
esac
exit $RETVAL
exit $RETVAL

View file

@ -8,7 +8,7 @@
Name: awips2-postgresql
Summary: AWIPS II PostgreSQL Distribution
Version: %{_postgresql_version}
Release: 1.el6
Release: 2.el6
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}

View file

@ -36,8 +36,6 @@ PGDATA_DIR="${POSTGRESQL_INSTALL_ROOT}/data"
PGDATA="${PGDATA_DIR}"
# Who to run the postmaster as, usually "postgres". (NOT "root")
PGUSER=awips
# Port to start the database with
PGPORT=5432
# Where to keep a log file
PGLOG="$PGDATA/serverlog"
# The path that is to be used for the script
@ -57,29 +55,29 @@ PGCTL="${POSTGRESQL_INSTALL}/bin/pg_ctl"
case $1 in
start)
echo -n "Starting EDEX PostgreSQL: "
su $PGUSER -c "$DAEMON -D '$PGDATA' -p $PGPORT &" >>$PGLOG 2>&1
su $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
echo
RETVAL=$?
;;
stop)
echo -n "Stopping EDEX PostgreSQL: "
su $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -o \"-p $PGPORT\""
su $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
echo
RETVAL=$?
;;
restart)
echo -n "Restarting EDEX PostgreSQL: "
su $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w -o \"-p $PGPORT\""
su $PGUSER -c "$DAEMON -D '$PGDATA' -p $PGPORT &" >>$PGLOG 2>&1
su $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast -w"
su $PGUSER -c "$DAEMON -D '$PGDATA' &" >>$PGLOG 2>&1
RETVAL=$?
;;
reload)
echo -n "Reload EDEX PostgreSQL: "
su $PGUSER -c "$PGCTL reload -D '$PGDATA' -s -o \"-p $PGPORT\""
su $PGUSER -c "$PGCTL reload -D '$PGDATA' -s"
RETVAL=$?
;;
status)
su $PGUSER -c "$PGCTL status -D '$PGDATA' -o \"-p $PGPORT\""
su $PGUSER -c "$PGCTL status -D '$PGDATA'"
;;
*)
# Print help

View file

@ -11,9 +11,6 @@ prefix="${POSTGRESQL_INSTALL}/postgresql"
# Data Directory
PGDATA="${POSTGRESQL_INSTALL}/data"
# Port to start the database with
PGPORT=5432
# Where to keep a log file
PGLOG="$PGDATA/serverlog"
@ -40,7 +37,7 @@ set -e
test -x $DAEMON || exit 0
echo -n "Starting PostgreSQL: "
$DAEMON -D $PGDATA -p $PGPORT
$DAEMON -D $PGDATA

View file

@ -11,9 +11,6 @@ prefix="${POSTGRESQL_INSTALL}/postgresql"
# Data Directory
PGDATA="${POSTGRESQL_INSTALL}/data"
# Port to start the database with
PGPORT=5432
# Where to keep a log file
PGLOG="$PGDATA/serverlog"
@ -40,7 +37,7 @@ set -e
test -x $DAEMON || exit 0
echo -n "Starting PostgreSQL: "
$DAEMON -D $PGDATA -p $PGPORT
$DAEMON -D $PGDATA