summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-02-27 12:07:42 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-02-27 12:07:42 +0100
commit28c5dbbab21fb19606cb548582885458928eda30 (patch)
treed1ed9309ab8326ddb0d846f88ca70b525568b69f
parent09cc145b8bd877966f5efe739597d6338ab2d1a4 (diff)
downloadpostgresql-setup-28c5dbbab21fb19606cb548582885458928eda30.tar.gz
postgresql-setup-28c5dbbab21fb19606cb548582885458928eda30.tar.xz
postgresql-setup-28c5dbbab21fb19606cb548582885458928eda30.zip
configury: add INITDB_SCLS variable
This brings space separated list of Software Collections to be enabled with call to 'initdb' binary. * configure.ac (INITDB_SCLS): New variable. * postgresql-setup.in ($initdb_scls): New global. (perform_initdb): Source appropriate environment based on $initdb_scls content.
-rw-r--r--configure.ac4
-rw-r--r--postgresql-setup.in11
2 files changed, 14 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a6ed1fb..5d31cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -213,6 +213,10 @@ PGSETUP_SUBST_OPT([NAME_DEFAULT_PREV_SERVICE], [postgresql],
[name of service to upgrade from by default (defaults to
'postgresql'])
+PGSETUP_SUBST_OPT([INITDB_SCLS], [],
+ [mention software collections which should be
+ enabled for '--initdb' command])
+
NAME_BINARYBASE="$NAME_BIN_PFX""postgresql$NAME_BIN_SFX"
NAME_PACKAGE="$NAME_PKG_PFX""postgresql$NAME_PKG_SFX"
NAME_SERVICE="$NAME_SRV_PFX""postgresql$NAME_SRV_SFX"
diff --git a/postgresql-setup.in b/postgresql-setup.in
index e0c3184..e1384cc 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -24,6 +24,9 @@ PGPORT_DEF=5432
# We upgrade by default from system's default PostgreSQL installation
option_upgradefrom="@NAME_DEFAULT_PREV_SERVICE@"
+# Space separated list of SCLS to be enabled during upgrade
+initdb_scls="@INITDB_SCLS@"
+
USAGE_STRING=$"\
Usage: $0 MODE_OPTION [--unit=UNIT_NAME] [OPTION...]
@@ -101,6 +104,7 @@ root_prereq()
test "$(id -u)" -eq 0 || die "$0 requires root access for this action"
}
+
read_config_file()
{
local key="" val=""
@@ -225,8 +229,13 @@ perform_initdb()
[ -x /sbin/restorecon ] && /sbin/restorecon "$initdb_log"
fi
+ local scls_initdb_hacks=
+ test -n "$initdb_scls" \
+ && scls_initdb_hacks="source scl_source enable $initdb_scls ; "
+
# Initialize the database
- initdbcmd="$PGENGINE/initdb --pgdata='$pgdata' --auth='ident'"
+ initdbcmd="$scls_initdb_hacks"
+ initdbcmd+=" $PGENGINE/initdb --pgdata='$pgdata' --auth='ident'"
initdbcmd+=" $PGSETUP_INITDB_OPTIONS"
$SU_POSTGRES -c "$initdbcmd" >> "$initdb_log" 2>&1 < /dev/null