Amend: wrap file access in try..finally; move StringBuilder outside of a loop Change-Id: Iafa7493ef79a0a891f36923f1695cefdb47e16da Former-commit-id:b2550c873b
[formerly0c3b22c8f2
] [formerly43008f4698
] [formerlyb2550c873b
[formerly0c3b22c8f2
] [formerly43008f4698
] [formerly120ebd045a
[formerly43008f4698
[formerly 71f74d7b8125994537ef5520fe59134a7f86e9af]]]] Former-commit-id:120ebd045a
Former-commit-id:a63bda59b4
[formerly68181d3f62
] [formerly 1ab6f3920db4e2de42353fe97a9c4fe694df0851 [formerlyfac9d72cc8
]] Former-commit-id: ea54fc6cf0eb39a2eb253d886a1e3180ccf382a0 [formerly9e0e6662c8
] Former-commit-id:fad82481c1
44 lines
944 B
Bash
44 lines
944 B
Bash
#!/bin/sh
|
|
|
|
## EDIT FROM HERE
|
|
|
|
# Use rpm to find installation locations / directory paths.
|
|
POSTGRESQL_INSTALL="/awips2"
|
|
|
|
# Installation prefix
|
|
prefix="${POSTGRESQL_INSTALL}/postgresql"
|
|
|
|
# Data Directory
|
|
PGDATA="${POSTGRESQL_INSTALL}/data"
|
|
|
|
# Where to keep a log file
|
|
PGLOG="$PGDATA/serverlog"
|
|
|
|
USER=`whoami`
|
|
|
|
## STOP EDITING HERE
|
|
|
|
# The path that is to be used for the script
|
|
PATH=${POSTGRESQL_INSTALL}/postgresql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
export LD_LIBRARY_PATH=${POSTGRESQL_INSTALL}/postgresql/lib
|
|
|
|
# What to use to start up the postmaster (we do NOT use pg_ctl for this,
|
|
# as it adds no value and can cause the postmaster to misrecognize a stale
|
|
# lock file)
|
|
DAEMON="$prefix/bin/postmaster"
|
|
|
|
# What to use to shut down the postmaster
|
|
PGCTL="$prefix/bin/pg_ctl"
|
|
|
|
set -e
|
|
|
|
# Only start if we can find the postmaster.
|
|
test -x $DAEMON || exit 0
|
|
|
|
echo -n "Starting PostgreSQL: "
|
|
$DAEMON -D $PGDATA
|
|
|
|
|
|
|
|
exit 0
|