]> TLD Linux GIT Repositories - packages/postgresql.git/commitdiff
- don't hardcode version in init
authorMarcin Krol <hawk@tld-linux.org>
Thu, 23 Aug 2018 10:52:08 +0000 (10:52 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 23 Aug 2018 10:52:08 +0000 (10:52 +0000)
postgresql.init
postgresql.spec

index ac82745e5bf709c5390b2ef73b44e09b443f9a52..8f308171836413e5dd01472b7f7de22c59985606 100644 (file)
@@ -21,10 +21,10 @@ cd /
 PG_INIT_LOCALE=C
 
 # Get service config
-if [ -f /etc/sysconfig/postgresql10 ]; then
-       . /etc/sysconfig/postgresql10
+if [ -f /etc/sysconfig/postgresql-@pgsqlversion@ ]; then
+       . /etc/sysconfig/postgresql-@pgsqlversion@
 else
-       nls "Error: %s not found" /etc/sysconfig/postgresql10
+       nls "Error: %s not found" /etc/sysconfig/postgresql-@pgsqlversion@
        nls " PostgreSQL can't be run."
        exit 1
 fi
@@ -106,11 +106,11 @@ pgsubsys() {
        for pgdir in $PG_DB_CLUSTERS; do
                pgstatus "$pgdir"
                if [ "$PG_STATUS" = "running" ]; then
-                       touch /var/lock/subsys/postgresql10
+                       touch /var/lock/subsys/postgresql-@pgsqlversion@
                        return
                fi
        done
-       rm -f /var/lock/subsys/postgresql10
+       rm -f /var/lock/subsys/postgresql-@pgsqlversion@
 }
 
 #
index aa5b9db40333bceec51309ac755e677ddaa31b46..2293b1b1b87972833e3cc88f867a69e9b5d8d433 100644 (file)
@@ -681,7 +681,7 @@ done
 
 touch $RPM_BUILD_ROOT/var/log/pgsql
 
-sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgversion}
+sed -e 's,@pgsqlbindir@,%{pgsqllibdir}/bin,g; s,@pgsqlversion@,%{pgversion},g;' %{SOURCE1} >$RPM_BUILD_ROOT/etc/rc.d/init.d/postgresql-%{pgversion}
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/postgresql-%{pgversion}
 
 install -d howto