Skip to content
Snippets Groups Projects
Commit a635c923 authored by Christoph Berg's avatar Christoph Berg 📡
Browse files

rpm: install /etc/postgresql and other directories; relax dependency on lsb by...

rpm: install /etc/postgresql and other directories; relax dependency on lsb by also implementing log_failure_msg
parent 2e0d436b
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,9 @@
# package init.d scripts. It is usually included by
# /etc/init.d/postgresql
. /lib/lsb/init-functions
#redhat# . /usr/share/postgresql-common/init-functions-compat
init_functions=/lib/lsb/init-functions
#redhat# init_functions=/usr/share/postgresql-common/init-functions-compat
. $init_functions
PGBINROOT="/usr/lib/postgresql/"
#redhat# PGBINROOT="/usr/pgsql-"
......
......@@ -46,4 +46,7 @@ Differences between the Debian and RedHat operating modes are:
there is no automatic integration of tsearch with system-provided
dictionaries.
The postgresql-common testsuite is supported if perl-Test-Simple and
perl-Time-HiRes are installed.
-- Christoph Berg <christoph.berg@credativ.de> Thu, 26 Jun 2014 16:59:47 +0200
......@@ -7,3 +7,5 @@ function_exists () {
function_exists log_daemon_msg || log_daemon_msg () { echo -n "$1:${2:+ $2}"; }
function_exists log_progress_msg || log_progress_msg () { echo -n " $1"; }
function_exists log_end_msg || log_end_msg () { if [ $1 -eq 0 ]; then echo "."; else echo "failed!"; fi; }
# this one exists, but we provide it anyway so we don't need to depend on redhat-lsb-core:
function_exists log_failure_msg || log_failure_msg () { echo "$1"; }
......@@ -104,10 +104,13 @@ cp debian/logrotate.template %{buildroot}/etc/logrotate.d/postgresql-common
%files -n postgresql-server-dev-all -f files-postgresql-server-dev-all
%post
# create postgres user
groupadd -g 26 -o -r postgres >/dev/null 2>&1 || :
useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \
-c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || :
# create directories so postgres can create clusters without root
install -d -o postgres -g postgres /etc/postgresql /var/lib/postgresql /var/lib/pgsql /var/log/postgresql /var/run/postgresql
# install logrotate config
version_lt () {
newest=$( ( echo "$1"; echo "$2" ) | sort -V | tail -n1)
[ "$1" != "$newest" ]
......
......@@ -71,7 +71,7 @@ if [ "${INSTALL:-}" ] && [ -z "${UNSHARED:-}" ]; then
hunspell-en-us
fi
# requirements on RedHat:
# perl-Time-HiRes
# perl-Test-Simple perl-Time-HiRes
# re-exec ourselves through unshare
if [ -z "$UNSHARED" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment