aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2012-05-27 10:39:36 -0400
committerAaron W. Swenson <titanofold@gentoo.org>2012-05-27 10:39:36 -0400
commit4f4d27dfb865f7285c746a4c8ec458dfddd82108 (patch)
treef4632014ae61a15f27f65f50981c4edde0e76d63
parentFixes b.g.o bug 407907. awk syntax fix for FreeBSD. (diff)
downloadpatches-4f4d27dfb865f7285c746a4c8ec458dfddd82108.tar.gz
patches-4f4d27dfb865f7285c746a4c8ec458dfddd82108.tar.bz2
patches-4f4d27dfb865f7285c746a4c8ec458dfddd82108.zip
More descriptive comments.
-rwxr-xr-xpostgresql.init13
1 files changed, 10 insertions, 3 deletions
diff --git a/postgresql.init b/postgresql.init
index afef398..6d27683 100755
--- a/postgresql.init
+++ b/postgresql.init
@@ -26,12 +26,14 @@ socket_path=$(get_config unix_socket_path)
: ${socket_path:=@RUNDIR@/run/postgresql}
checkconfig() {
- # Check that DATA_DIR has been set and exists
+ # Check that DATA_DIR has been set
if [ -z ${DATA_DIR} ] ; then
eerror "DATA_DIR not set"
eerror "HINT: Perhaps you need to update /etc/conf.d/postgresql-@SLOT@"
return 1
fi
+
+ # Check that DATA_DIR exists
if [ ! -d ${DATA_DIR} ] ; then
eerror "Directory not found: ${DATA_DIR}"
eerror "HINT: Ensure that DATA_DIR points to the right path."
@@ -40,7 +42,10 @@ checkconfig() {
return 1
fi
- # Check for the existence of PostgreSQL's config files.
+ # Check for the existence of PostgreSQL's config files, and set the
+ # proper mode and ownership.
+ # Only three files should be checked as potentially other files
+ # may be in PGDATA that should not be touched.
local file
for file in postgresql pg_hba pg_ident ; do
file="${PGDATA%/}/${file}.conf"
@@ -53,7 +58,8 @@ checkconfig() {
fi
done
- # Check the socket directory
+ # Set the proper permission for the socket path and create it if
+ # it doesn't exist.
checkpath -d -m 0770 -o postgres:postgres ${socket_path}
if [ -e ${socket_path%/}/.s.PGSQL.${configured_port} ] ; then
eerror "Socket conflict."
@@ -114,6 +120,7 @@ stop() {
retries="${retries}/SIGQUIT/${FORCE_TIMEOUT}"
fi
+ # Loops through nice, rude, and force quite in one go.
start-stop-daemon --stop \
--exec /usr/lib/postgresql-@SLOT@/bin/postgres \
--retry ${retries} \