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
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@
}
#
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