summaryrefslogtreecommitdiff
path: root/databases
diff options
context:
space:
mode:
authorjlam <jlam>2002-04-05 16:23:23 +0000
committerjlam <jlam>2002-04-05 16:23:23 +0000
commit2fcb872e9b04cd760183b807faad94c99da2904f (patch)
tree78b48f2ab0ffc1fe25afb66ac5d5167c3b91e76f /databases
parent4611688bcbaf85e86a063309ed34b19a7b718d99 (diff)
downloadpkgsrc-2fcb872e9b04cd760183b807faad94c99da2904f.tar.gz
Add a few error checks for whether the commands we want to execute actually
exist.
Diffstat (limited to 'databases')
-rw-r--r--databases/postgresql-server/files/pgsql.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/databases/postgresql-server/files/pgsql.sh b/databases/postgresql-server/files/pgsql.sh
index 041e81f3887..3b5e633e6ef 100644
--- a/databases/postgresql-server/files/pgsql.sh
+++ b/databases/postgresql-server/files/pgsql.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: pgsql.sh,v 1.8 2002/04/05 09:50:16 abs Exp $
+# $NetBSD: pgsql.sh,v 1.9 2002/04/05 16:23:23 jlam Exp $
#
# PostgreSQL database rc.d control script
#
@@ -54,13 +54,19 @@ pgsql_precmd()
pgsql_initdb()
{
+ initdb="@PREFIX@/bin/initdb"
+
+ if [ ! -x ${initdb} ]
+ then
+ return
+ fi
if [ -f ${PGHOME}/data/base/1/PG_VERSION ]
then
@ECHO@ "The PostgreSQL template databases have already been initialized."
@ECHO@ "Skipping database initialization."
else
@ECHO@ "Initializing PostgreSQL databases."
- @SU@ -m ${pgsql_user} -c "@PREFIX@/bin/initdb ${command_args} ${flags}"
+ @SU@ -m ${pgsql_user} -c "${initdb} ${command_args} ${flags}"
fi
}
@@ -81,6 +87,11 @@ pgsql_doit()
;;
esac
+ if [ ! -x ${ctl_command} ]
+ then
+ return
+ fi
+
case ${action} in
start) @ECHO@ "Starting ${name}." ;;
stop) @ECHO@ "Stopping ${name}." ;;