X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=postgresql.init;h=ac82745e5bf709c5390b2ef73b44e09b443f9a52;hb=b19a7e8f4294c339af9665aee5d786b36d9b26af;hp=647f2ec4328af6cab69cf80b305ae8a7c25863b1;hpb=5e86bde66b513fe5ccfc11a9efcfe49cd38a5478;p=packages%2Fpostgresql.git diff --git a/postgresql.init b/postgresql.init index 647f2ec..ac82745 100644 --- a/postgresql.init +++ b/postgresql.init @@ -21,10 +21,10 @@ cd / PG_INIT_LOCALE=C # Get service config -if [ -f /etc/sysconfig/postgresql ]; then - . /etc/sysconfig/postgresql +if [ -f /etc/sysconfig/postgresql10 ]; then + . /etc/sysconfig/postgresql10 else - nls "Error: %s not found" /etc/sysconfig/postgresql + nls "Error: %s not found" /etc/sysconfig/postgresql10 nls " PostgreSQL can't be run." exit 1 fi @@ -73,7 +73,7 @@ fi pgstatus() { PG_STATUS="unknown" PG_PID="unknown" - output=$(LC_ALL=C TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $1 status") + output=$(LC_ALL=C TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -D $1 status") status=$? if [ $status -eq 3 ]; then @@ -94,7 +94,7 @@ pgstatus() { pgstart() { is_no "$RC_LOGGING" && fork=--fork msg_starting "PostgreSQL $1" - daemon $fork --user postgres /usr/bin/pg_ctl -s -w -D $1 start + daemon $fork --user postgres @pgsqlbindir@/pg_ctl -s -w -D $1 start } # @@ -106,11 +106,11 @@ pgsubsys() { for pgdir in $PG_DB_CLUSTERS; do pgstatus "$pgdir" if [ "$PG_STATUS" = "running" ]; then - touch /var/lock/subsys/postgresql + touch /var/lock/subsys/postgresql10 return fi done - rm -f /var/lock/subsys/postgresql + rm -f /var/lock/subsys/postgresql10 } # @@ -149,7 +149,7 @@ stop() { busy # is postgresql really alive? if ps -p "$PG_PID" >/dev/null; then - TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -w -D $pgdir stop -m fast 2>&1 >/dev/null" + TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -w -D $pgdir stop -m fast 2>&1 >/dev/null" pgstatus "$pgdir" if [ "$PG_STATUS" != "not running" ]; then fail @@ -215,7 +215,7 @@ case "$action" in busy # is postgresql really alive? if ps -p "$PG_PID" >/dev/null; then - TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $pgdir $pgctlact 2>&1 >/dev/null" + TMPDIR=/tmp su postgres -c "@pgsqlbindir@/pg_ctl -D $pgdir $pgctlact 2>&1 >/dev/null" pgstatus "$pgdir" if [ "$PG_STATUS" = "running" ]; then ok @@ -249,7 +249,7 @@ case "$action" in mkdir -p $pgdir chmod 700 $pgdir chown postgres:postgres $pgdir - LC_ALL=$PG_INIT_LOCALE TMPDIR=/tmp su postgres -s /bin/sh -c "initdb -E UNICODE --data-checksums -D $pgdir" + LC_ALL=$PG_INIT_LOCALE TMPDIR=/tmp su postgres -s /bin/sh -c "@pgsqlbindir@/initdb -E UNICODE --data-checksums -D $pgdir" fi done echo $(nls "REMEMBER to setup password for user \"postgres\"")'!'