diff options
author | jlam <jlam> | 2002-04-05 16:23:23 +0000 |
---|---|---|
committer | jlam <jlam> | 2002-04-05 16:23:23 +0000 |
commit | 5334111331be33341a9f1cb332d6275b93f94ea9 (patch) | |
tree | 78b48f2ab0ffc1fe25afb66ac5d5167c3b91e76f /databases | |
parent | a9efc7d415ff93d6b627efb694e5e8c8aec32145 (diff) | |
download | pkgsrc-5334111331be33341a9f1cb332d6275b93f94ea9.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.sh | 15 |
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}." ;; |