aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2012-05-27 10:41:38 -0400
committerAaron W. Swenson <titanofold@gentoo.org>2012-05-27 10:41:38 -0400
commit36a2cef1e4043345c4d33bd71bb905efbede7202 (patch)
tree4a2da923b62ee171de177d67a3f0fbf460eec64b
parentMore descriptive comments. (diff)
downloadpatches-36a2cef1e4043345c4d33bd71bb905efbede7202.tar.gz
patches-36a2cef1e4043345c4d33bd71bb905efbede7202.tar.bz2
patches-36a2cef1e4043345c4d33bd71bb905efbede7202.zip
More doubled slash prevention.
-rwxr-xr-xpostgresql.init14
1 files changed, 7 insertions, 7 deletions
diff --git a/postgresql.init b/postgresql.init
index 6d27683..fd8368c 100755
--- a/postgresql.init
+++ b/postgresql.init
@@ -6,7 +6,7 @@
extra_started_commands="reload"
get_config() {
- [ -f ${PGDATA}/postgresql.conf ] || return 1
+ [ -f ${PGDATA%/}/postgresql.conf ] || return 1
eval echo $(sed -e 's:#.*::' ${PGDATA%/}/postgresql.conf | awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }')
}
@@ -75,7 +75,7 @@ start() {
ebegin "Starting PostgreSQL"
- rm -f ${DATA_DIR}/postmaster.pid
+ rm -f ${DATA_DIR%/}/postmaster.pid
local extraenv
local x
@@ -87,15 +87,15 @@ start() {
--user postgres \
--env "PGPORT=${configured_port}" \
${extraenv} \
- --pidfile ${DATA_DIR}/postmaster.pid \
+ --pidfile ${DATA_DIR%/}/postmaster.pid \
--exec /usr/lib/postgresql-@SLOT@/bin/pg_ctl \
- -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR}/postmaster.log \
+ -- start -s -w -t ${START_TIMEOUT} -l ${DATA_DIR%/}/postmaster.log \
-D ${PGDATA} -o "--data-directory=${DATA_DIR} ${PGOPTS}"
local retval=$?
if [ $retval -ne 0 ] ; then
eerror "Check the log for a possible explanation of the above error."
- eerror " ${DATA_DIR}/postmaster.log"
+ eerror " ${DATA_DIR%/}/postmaster.log"
eend $retval
return $retval
fi
@@ -124,13 +124,13 @@ stop() {
start-stop-daemon --stop \
--exec /usr/lib/postgresql-@SLOT@/bin/postgres \
--retry ${retries} \
- --pidfile ${DATA_DIR}/postmaster.pid
+ --pidfile ${DATA_DIR%/}/postmaster.pid
eend
}
reload() {
ebegin "Reloading PostgreSQL configuration"
- kill -HUP $(head -n1 ${DATA_DIR}/postmaster.pid)
+ kill -HUP $(head -n1 ${DATA_DIR%/}/postmaster.pid)
eend $?
}