summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am10
-rw-r--r--NEWS3
-rw-r--r--initdb.in16
-rw-r--r--legacy-sysv-script.in6
-rw-r--r--upgrade.in16
5 files changed, 12 insertions, 39 deletions
diff --git a/Makefile.am b/Makefile.am
index 32d2749..d303110 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ systemdunitsdir = $(prefix)/lib/systemd/system
systemdunits_DATA = postgresql$(DISTSUFF).service postgresql$(DISTSUFF)@.service
systemdlegacyscriptsdir = $(prefix)/libexec/initscripts/legacy-actions/postgresql$(DISTSUFF)
-systemdlegacyscripts_DATA = initdb upgrade
+systemdlegacyscripts_SCRIPTS = initdb upgrade
endif
doc_DATA = $(README_DIST_BASENAME)
@@ -37,12 +37,8 @@ postgresql$(DISTSUFF)-check-db-dir: postgresql-check-db-dir.in $(c_s)
postgresql$(DISTSUFF): postgresql.init.in $(c_s)
$(INSTANTIATE)
-initdb: initdb.in $(c_s)
+initdb upgrade: legacy-sysv-script.in $(c_s)
$(INSTANTIATE_SCRIPT)
-upgrade: upgrade.in $(c_s)
- $(INSTANTIATE_SCRIPT)
-
-
# In ideal world, postgresql@.service would be hardlink to postgresql.service.
# That would require, however, the rhbz#1141824 resolved so we could install
@@ -69,7 +65,7 @@ GENERATED_FILES = $(bin_SCRIPTS) \
$(pkgsysconf_DATA) \
$(systemdunits_DATA) \
$(initscripts_DATA) \
- $(systemdlegacyscripts_DATA)
+ $(systemdlegacyscripts_SCRIPTS)
CLEANFILES = $(GENERATED_FILES) $(TEST_GEN_FILES_LIST)
diff --git a/NEWS b/NEWS
index dae256a..adbfef8 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ New in 3.0 version
* postgresql-setup now works if postgres user is /bin/nologin
+* Legacy scripts are now generated from single template file, also are
+ simplified a bit.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 2.0 version
diff --git a/initdb.in b/initdb.in
deleted file mode 100644
index c238574..0000000
--- a/initdb.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Legacy action script for "service postgresql initdb"
-
-# Find the name of the service
-SERVICE_NAME=$(basename $(dirname "$0"))
-if [ x"$SERVICE_NAME" = x. ]
-then
- SERVICE_NAME=postgresql
-fi
-
-echo Hint: the preferred way to do this is now '"postgresql-setup initdb"' >&2
-
-/usr/bin/postgresql-setup initdb "$SERVICE_NAME"
-
-exit $?
diff --git a/legacy-sysv-script.in b/legacy-sysv-script.in
new file mode 100644
index 0000000..fb26a49
--- /dev/null
+++ b/legacy-sysv-script.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Legacy action script for "service postgresql --@__FILE__@"
+cmd="@bindir@/postgresql-setup --@__FILE__@ postgresql@DISTSUFF@"
+echo "Hint: the preferred way to do this is now \"$cmd\"" >&2
+$cmd
diff --git a/upgrade.in b/upgrade.in
deleted file mode 100644
index c542494..0000000
--- a/upgrade.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Legacy action script for "service postgresql upgrade"
-
-# Find the name of the service
-SERVICE_NAME=$(basename $(dirname "$0"))
-if [ x"$SERVICE_NAME" = x. ]
-then
- SERVICE_NAME=postgresql
-fi
-
-echo Hint: the preferred way to do this is now '"postgresql-setup upgrade"' >&2
-
-/usr/bin/postgresql-setup upgrade "$SERVICE_NAME"
-
-exit $?